WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Rachel Ambler
    Member
    Posted 2 months 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 2 months ago #

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

  3. Rachel Ambler
    Member
    Posted 2 months ago #

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

    Thanks!

Reply

You must log in to post.

About this Theme

About this Topic

Tags

No tags yet.