The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Excluding the "read more" from specific categories... (2 posts)

  1. iamharlan
    Posted 6 years ago #

    I posted a topic a while back about a one category exception to a rule on the homepage of my blog. Well...the point was that I wanted to show a whole post for a specific category, and the truncated post for all other categories. I was successful with this code:

    <?php if (in_category('pages')) {
                      global $more;
                      $more = 1;
                      } else truncate_post(410, ""); ?>
                    <a href="<?php the_permalink() ?>" rel="bookmark" class="readmore" title="Permanent Link to <?php the_title(); ?>">
        read more

    Now...because I am showing the whole post on the category "pages", I have no need to have the "readmore" link on those posts. Conversely, I do want to keep the readmore for the posts that have been truncated.

    So my question is, how do I include the absence of the "readmore" link from the "pages" category, but have it function as usual for all other categories? Should I create another if/else, or can I simply include it in the existing code somehow?

  2. iamharlan
    Posted 6 years ago #


Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.