WordPress.org

Ready to get started?Download WordPress

Forums

Excerpt and dots (3 posts)

  1. Ebrark
    Member
    Posted 1 year ago #

    I want dotssss to be shown after the length of excerpt , below is a code taken from blog-item.php , can someone help me

    echo '<div class="blog-thumbnail-context">';
    echo '<div class="blog-thumbnail-content">' . mb_substr( get_the_excerpt(), 0, $num_excerpt ) . '</div>';
    echo '' . $translator_continue_reading . '';
    echo '</div>'; // blog-thumbnail-context

  2. curlybracket
    Member
    Posted 1 year ago #

    Just add dots after the excerpt :

    echo '<div class="blog-thumbnail-context">';
    echo '<div class="blog-thumbnail-content">' . mb_substr( get_the_excerpt(), 0, $num_excerpt ) . '…</div>';
    echo '' . $translator_continue_reading . '';
    echo '</div>'; // blog-thumbnail-context

    or

    <div class="blog-thumbnail-context">
     <div class="blog-thumbnail-content"><? the_excerpt() ?>…</div>';
     echo $translator_continue_reading;
    </div>

    You could also add the dots only if the excerpt is longer than what you show like this :

    Just add dots after the excerpt :

    echo '<div class="blog-thumbnail-context">';
    echo '<div class="blog-thumbnail-content">' . mb_substr( get_the_excerpt(), 0, $num_excerpt );
    if(strlen(get_the_excerpt()) > $num_excerpt) echo '…';
    echo '</div>' . $translator_continue_reading . '';
    echo '</div>'; // blog-thumbnail-context

    More info on excerpts http://codex.wordpress.org/Function_Reference/the_excerpt

  3. Ebrark
    Member
    Posted 1 year ago #

    Hey thanks alot mateeee

Topic Closed

This topic has been closed to new replies.

About this Topic