Support » Fixing WordPress » Excerpt and dots

  • 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

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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

    Hey thanks alot mateeee

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Excerpt and dots’ is closed to new replies.