Skip to main content
Tweeted twitter.com/StackWordPress/status/991442361141137408
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
clear title, formatted HTML code, small spelling and grammer fixes
Source Link

stop the Customizing get_the_excerpt() to specific length and "Read More" output.

I am costuming a template. There is a list grabbing the introduction formfrom the first 1-2 paragraphs (all the articles from a category). If I only set the excerpt to 295 words, sometimes the list grabs additional words from the next paragraph. I would like to add a Read More tag to stop it. Can someone help me with that part?

Thank you very much.

<div id="all-div-cabrand-content-stories">
    <div class="kids-families-con-cabrand-stories"><stories">
        <?php echo get_the_post_thumbnail($page->ID, 'thubmnailstorysmall'); ?><>
    </div>
    <div class="kids-con-cabrand-new-stories">
<span><        <span>
            <?php print substr(get_the_excerpt(),wp_trim_excerpt(),295); ?>
            <i><a style="color:#1975D1;float:Right;" class="title" href="<?php the_permalink() ?>" rel="bookmark">Click for Story & Video</a><br/><a></i>
            <br/>
        </span>
    </div>
</div>

stop the get_the_excerpt

I am costuming a template. There is a list grabbing the introduction form the first 1-2 paragraphs (all the articles from a category). If I only set the excerpt to 295 words, sometimes the list grabs additional words from the next paragraph. I would like to add a Read More tag to stop it. Can someone help me with that part?

Thank you very much.

<div id="all-div-cabrand-content-stories">
<div class="kids-families-con-cabrand-stories"><?php echo get_the_post_thumbnail($page->ID, 'thubmnailstorysmall'); ?></div>
<div class="kids-con-cabrand-new-stories">
<span><?php print substr(get_the_excerpt(),wp_trim_excerpt(),295); ?>
<i><a style="color:#1975D1;float:Right;" class="title" href="<?php the_permalink() ?>" rel="bookmark">Click for Story & Video</a><br/></i>
</span>
</div>
</div>

Customizing get_the_excerpt() to specific length and "Read More" output.

I am costuming a template. There is a list grabbing the introduction from the first 1-2 paragraphs (all the articles from a category). If I set the excerpt to 295 words, sometimes the list grabs additional words from the next paragraph. I would like to add a Read More tag to stop it. Can someone help me with that part?

<div id="all-div-cabrand-content-stories">
    <div class="kids-families-con-cabrand-stories">
        <?php echo get_the_post_thumbnail($page->ID, 'thubmnailstorysmall'); ?>
    </div>
    <div class="kids-con-cabrand-new-stories">
        <span>
            <?php print substr(get_the_excerpt(),wp_trim_excerpt(),295); ?>
            <i><a style="color:#1975D1;float:Right;" class="title" href="<?php the_permalink() ?>" rel="bookmark">Click for Story & Video</a></i>
            <br/>
        </span>
    </div>
</div>
Source Link
Chrisq
  • 61
  • 1
  • 1
  • 2

stop the get_the_excerpt

I am costuming a template. There is a list grabbing the introduction form the first 1-2 paragraphs (all the articles from a category). If I only set the excerpt to 295 words, sometimes the list grabs additional words from the next paragraph. I would like to add a Read More tag to stop it. Can someone help me with that part?

Thank you very much.

<div id="all-div-cabrand-content-stories">
<div class="kids-families-con-cabrand-stories"><?php echo get_the_post_thumbnail($page->ID, 'thubmnailstorysmall'); ?></div>
<div class="kids-con-cabrand-new-stories">
<span><?php print substr(get_the_excerpt(),wp_trim_excerpt(),295); ?>
<i><a style="color:#1975D1;float:Right;" class="title" href="<?php the_permalink() ?>" rel="bookmark">Click for Story & Video</a><br/></i>
</span>
</div>
</div>