Support » Theme: Baskerville » show html in post excerpts on home pages

  • Resolved Nitaai

    (@nitaaikumar)


    Please how can I show full html in excerpts on home page? Anything I can add in functions.php of the child theme or some other way? Thanks for your excellent theme. It is one only third-party free theme to support all post formats with a fully masonry grid layout.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author Anders Norén

    (@anlino)

    Hi @nitaaikumar,

    You’ll have to copy content.php from Baskerville to your child theme, and change the line:

    <?php the_excerpt( 100 ); ?>

    to:

    <?php the_excerpt(); ?>

    That will display the full length of the manually entered excerpts. It will escape most HTML though, since the clipping of the post_content can result in broken HTML if HTML tags are not escaped. If you don’t want this, you can probably replace the line with the following:

    <?php echo apply_filters( 'the_content', get_the_excerpt() ); ?>

    I wouldn’t recommend it though, for the reasons above.

    Glad you like it!

    — Anders

    Theme Author Anders Norén

    (@anlino)

    Said to be resolved in this thread, so marked as thus.

    Nitaai

    (@nitaaikumar)

    So sorry I did not post in this thread. The first code worked. Thanks.

    The problem is that now there is afull html5 video code in the excerpt field of each post. And Google shows post excerpts below the title. I don’t know if this will be bad for SEO.

    So am I right to think that I will need a SEO plugin now to separately put in a different meta excerpt value for each post instead of this normal excerpt which is so full with the html5 video code now? Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.