Forums

Conditional tags, categories and exclusion. (2 posts)

  1. Jenniferr
    Member
    Posted 2 years ago #

    I have a short story site and on the front page I want to make it so it only shows the excerpt. It works, this is what I have in my index.php:

    <?php if(is_category(1,2,3) || is_archive() || is_home()) {
    	the_excerpt();
    	} else {							the_content('(more)');
    } ?>

    I'm not exactly sure if using multiple categories work.. but anyway.

    It works fine, but I have another category called 'Recommendations' which is basically a category where all my recommendations go.

    It has the ID of 4, so that's why I did the 1,2,3 but I'm not sure if that's even 'allowed'?

    Anyway, for any post that comes up in archives/home/categories I don't want it to show up as an excerpt - but as a full post.

    Is this possible?

  2. Jenniferr
    Member
    Posted 2 years ago #

    I have a feeling I messed up the categories and such, at least I know that editing out the categories number only affects that particular category?

    I have a category-4.php which displays the_content() and not just the_excerpt() so all is well in that department.

    I just need to know how to exclude anything in category 4 from just showing the excerpt on the main page and archives now, help, please? :(

Topic Closed

This topic has been closed to new replies.

About this Topic