Home > Enterprise >  Show the summary in the title card
Show the summary in the title card

Time:01-06

I want the summary to appear instead of the title when the card is hovered over. That is, instead of:

<div  title="<?php the_title(); ?>" data-toggle="tooltip" data-placement="bottom">

I want to use the following code:

<div  title="<?php the_excerpt(); ?>" data-toggle="tooltip" data-placement="bottom">

When I use the code: title="<?php the_excerpt(); ?>"; The summary is displayed as: <p>summary</p>.

Is there a way to hide the <p></p> tag?

CodePudding user response:

Please try this it will not show the p tag

    <?php echo get_the_excerpt(); ?>

As per your requirement below is the full code.

<div  title="<?php echo get_the_excerpt(); ?>" data-toggle="tooltip" data-placement="bottom">
  • Related