• Resolved LilithX

    (@lilithx)


    Hi,

    I am trying to hide specific posts from my Blog page (not the main page) but still want them to show on another page (lightbox image gallery). I’ve tried a category excluder plugin but it hides posts from both pages. I just want it to hide from my blog page because they aren’t really “blog posts” just image descriptions which looks tacky. You can see what i mean here lucidwerx.com/portfolio and here lucidwerx.com/blog

    Any ideas?

    Thanks.

Viewing 1 replies (of 1 total)
  • Thread Starter LilithX

    (@lilithx)

    ok, I found the solution.

    Go to editor and select the page you wish to edit then do a search for this line:

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    Put the following code before the line above:

    <?php $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;
    query_posts(“cat=-8&paged=$paged”); ?>

    -8 would be the Category ID. If you want to exclude more categories from the page you would do the following:

    <?php $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;
    query_posts(“cat=-8,-9,-10&paged=$paged”); ?>

    This solution should work for any page that is showing posts, not just the index/main page. Hope this helps someone else.

Viewing 1 replies (of 1 total)
  • The topic ‘How to hide specific posts from specific pages?’ is closed to new replies.