• Hi,
    I need some help.
    I want to show some new post only in a category and not on the index page (which is my home page). And that specific category has to have the same look and functionalities as the index page (functions like <<more>>…like a second index page.
    That the new post can only be seen on a category is probably an if…else code. But I do not have many experience with that.

    Can someone help me out???
    Thanks in advance.

    Regards,
    Dave
    URL https://www.testingblog.nl (=Dutch)

Viewing 4 replies - 1 through 4 (of 4 total)
  • If this concerns just one category, you can use this:
    <?php if (in_category('86')) continue; ?>
    Where “86” is the category I exclude. This is put in the index.php, just below “the loop” (<?php while (have_posts()) : the_post(); ?>).

    There are also category excluder plugins to do this for you.

    Thread Starter testingblog

    (@testingblog)

    Thanks!
    This is working.
    However, is it also possible that the layout of this category page is the same as on index? Now it is a list of links to single pages. I would like this to be as on index, title, part of the whole text and a read more link.
    Can some help me with this?

    For that you’ll have to change your archive.php which is apparently quite different from your index.php. This is not the case in most themes. Just compare your archive.php to your index.php and you’ll probably find the_title instead of the_content and some other things.

    Hi,
    My question is the same as this one but I’m not sure I understand the answer…

    If this concerns just one category, you can use this:
    <?php if (in_category(’86’)) continue; ?>
    Where “86” is the category I exclude. This is put in the index.php, just below “the loop” (<?php while (have_posts()) : the_post(); ?>).

    How would you handle this with multiple categories?
    Is the index page considered a category and if so could it be excluded if the posting is to another category?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to display a new post only in category and not on index’ is closed to new replies.