[resolved] Excluding Categories in the Loop (4 posts)

  1. cchestnut
    Posted 5 years ago #

    Okay, let me start out by saying that I am an absolute amateur with almost no time to really study code properly. I work for a newspaper and last May they had me take about a month to set up a new site for them, and during that time I was able to spend a lot of time on the forums figuring out how to make the site do what they wanted.

    So now, about nine months later, they want to make a few improvements, one of which is to remove all non-"News" categories from the home page and (what I think is called) the Loop...the pages that link at the bottom of the home page, 1, 2, 3, etc.:



    I know how to exclude categories from the home page, but I can't make it work beyond that. I don't have a whole lot of time right now to spend figuring this out, as we have a smaller staff now and I have more responsibilities. I did do some searches in the forums and I tried some of the codes that were suggested, but wasn't able to get them to work in the limited time I had available. Also, many of them results were well out of date with the most recent versions of WordPress, which may be why they didn't work.

    It's been two weeks since I was able to get back to this, but this morning I found a plug-in called Category Visibility -iPeat Rev. This plug-in did exactly what they wanted, BUT it also caused some weird glitches in the Listings in my drop-down menus: as soon as I activated it, three child categories disappeared and our Sports page was reassigned as a child category of the Special Interest category. I tried adjusting the settings, etc., and that didn't work. The only way to make the categories reappear properly was to deactivate the plug-in. Unfortunately, the plug-in developers don't seem to be supporting it anymore, so visiting their site wasn't much help either.

    So does anyone know a quick, easy way to exclude these categories, or can anyone point me toward a plug-in or "how to" that can help me out?


  2. 123milliseconds
    Posted 5 years ago #

  3. cchestnut
    Posted 5 years ago #

    Thanks for the link! I tried out their code and it's still not doing quite what I want it to do, but I'll keep playing with it and see what I can figure out.

  4. cchestnut
    Posted 5 years ago #

    Okay, I still couldn't get it to work, but I started wondering if it had something to do with my theme. I tracked down their support forums and sure enough there was a work around specific to the Magazine Basic theme. It was similar to what I had done before to exclude categories from the home page, but I had used the option2.php file for that before. This workaround used the index.php file and with just one line I was able to remove everything with no problems.

    On the chance that someone else happens to be using the same theme, here's the link to the code and the instructions: Themes by bavotasan

Topic Closed

This topic has been closed to new replies.

About this Topic