Filter category on home page in WPFolio (5 posts)

  1. mikieshow
    Posted 4 years ago #

    I’m trying to filter out a category of post from my home page ( (id 6, my podcasts). I found some code that is supposed to work, but I have it in the wrong place because it has prevented the previous/next links from working properly (they keep loading the same initial page of posts). When I remove this code things work properly but that category of posts I don’t want displayed (of course) have returned. I am not dumb but am no coder (when say ut this in the loop, I don't know what that means, for instance) Any help is greatly appreciated. Here’s the code I found, I put it in my child index.php

    		if ( is_home() ) {
    		query_posts( 'cat=-6' );


  2. mikieshow
    Posted 4 years ago #

    Sorry for the typos above. And here's my url if needed

  3. notlaura
    Posted 4 years ago #

    The loop is this if ( have_posts() ) : while ( have_posts() ) : the_post();. Your code is correct, just make sure it is below that line. Read more about the loop here. If this still isn't working, clear your browser history (cache and cookies especially).

    Also, when you are making modifications in theme files you should use a child theme otherwise your changes will be overwritten when you update the theme. Read about child themes here.

    Good luck!

  4. mikieshow
    Posted 4 years ago #

    Sadly, it didn't work. I put it where you suggested but the site won't load, it stalls loading 7 out of nine items or some such thing. I tried in a couple of lower locations but same thing. I'm at a loss and I realize you're at wordcamp now (your site is cool). I'll keep looking.

  5. mikieshow
    Posted 4 years ago #

    I found a plugin that will do it.

Topic Closed

This topic has been closed to new replies.

About this Topic