WordPress.org

Support

Support » Themes and Templates » [Resolved] Excerpt bug? (always on ellipses)

[Resolved] Excerpt bug? (always on ellipses)

  • 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?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Excerpt bug? (always on ellipses)’ is closed to new replies.