WordPress.org

Forums

MesoColumn
[resolved] Excerpt bug? (always on ellipses) (3 posts)

  1. Rachel Ambler
    Member
    Posted 1 year ago #

    theme-functions.php

    ////////////////////////////////////////////////////////////////////////////////
    // excerpt the_content()
    ////////////////////////////////////////////////////////////////////////////////
    function dez_get_custom_the_excerpt($limit) {
    if($limit == '' || $limit == '0') {
      } else {
      $excerpt = explode(' ', get_the_excerpt(), $limit);
    if (count($excerpt)>=$limit) {
        array_pop($excerpt);
        $excerpt = implode(" ",$excerpt).'...';
      } else {
        $excerpt = implode(" ",$excerpt).'...';
      }
      $excerpt = preg_replace('<code>\[[^\]]*\]</code>','',$excerpt);
      return $excerpt;
      }
    }

    Should the if statement not be

    if (count($excerpt)>=$limit) {
        array_pop($excerpt);
        $excerpt = implode(" ",$excerpt).'...';
      } else {
        $excerpt = implode(" ",$excerpt);

    To only show ellipses if the limit is breached?

  2. Richie KS
    Member
    Theme Author

    Posted 1 year ago #

    yeah, you're right, the '...' shouldn't show limit is not reached. will revise this. thx

  3. Rachel Ambler
    Member
    Posted 1 year ago #

    Cool - I'll change my copy for now and await your new version as and when.

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags

No tags yet.