The MU forums have moved to WordPress.org

How to remove the more link but still have a certain amount of words showing (5 posts)

  1. iwillpayou
    Member
    Posted 14 years ago #

    How to remove the more link but still have a certain amount of words showing??

    Right now I have something like <?php content('13'); ?>

    is there a way to limit words showing but not have a more link appearing?

  2. iwillpayou
    Member
    Posted 14 years ago #

    right now i am using this... Allows users to limit the number or words that are displayed when they want the excerpt or content of a post to appear.

    Instead of the_excerpt() or the_content(), use <?php excerpt('word-limit'); ?> or <?php content('word-limit'); ?> within your loop to limit the words for each.

    Example: <?php content('25'); ?>.

    how would i limit my words but not have a link that says more.. I do not want to show any link but just limit my words.

  3. iwillpayou
    Member
    Posted 14 years ago #

    anyone? any ideas?

  4. iwillpayou
    Member
    Posted 14 years ago #

    i found this.. but no such luck really so far..

    <?php global $more; $more = -1; //declare and set $more before The Loop ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); //begin The Loop ?>
    <?php
    if ($more == -1) { //do not use the more tag on the first one.
    the_content();
    $more = 0; //prevent this from happening again. use the more tag from now on.
    }
    else { //use the more tag
    the_content(__('Read more...'));
    }
    ?>
    <?php endwhile; //end of The Loop ?>

  5. dsader
    Member
    Posted 14 years ago #

    http://codex.wordpress.org/Template_Tags/the_excerpt

    You can filter the excerpt length and remove the [...] - the excerpt_more text.

    Both filters go in the functions.php of the template, the_excerpt(); goes in the loop.

About this Topic

  • Started 14 years ago by iwillpayou
  • Latest reply from dsader