WordPress.org

Forums

Having a hidden public category (6 posts)

  1. Xavier Borderie
    Member
    Posted 6 years ago #

    Hey there.

    I'd like a plugin or a hack to make it so that a given category of a blog is hidden from view, but still available to anyone knowing about it.

    Case in point: my little brother is leaving for a year abroad, and plans to write a travel blog (which I set up for him) so as to keep friends and families informed of his whereabouts.

    Thing is, he'd also like to write about the weird/crazy/shitty/fucked-up things that happen to him, but NOT have these available to our mother (who is worried enough already) - and not letting her know they even exist (so no password-protection, I think, since it's too obvious and might lead to questioning).
    The category should also not be displayed from the home-page (but that's a simple theme change).

    So, I was thinking of diving into his theme's Loop, changing it so that items from this verbotten category wouldn't appear on the home page, but would for any other place (like the monthly archive). But there might be better ideas out there...

    Is there a plugin that can help me with this for me? Or does anyones have an idea how I could go about it (I'm fairly well-versed in theme-dev, not in plugin-dev).

    Thanks a lot!

  2. moshu
    Member
    Posted 6 years ago #

    Extend > Plugins > Advanced Category Excluder?

  3. Roy
    Member
    Posted 6 years ago #

    Sure you can do that, but I don't think there's a plugin for everything at once.
    The first thing you can so is this:
    <?php if (in_category('20')) continue; ?>
    Which goes just below the loop in the places where you want to exclude the category (which in the example is category ID 20), so the index.php, perhaps the archive.php (not sure if that would work, since the category itself will use the archive.php) and search.php. Next you want to exclude the category from the category list, which (I think) can be done with a plugin.

    [edit] Yes, Moshu is right, but that plugin did not exactly what I wanted, but it's worth the try.

  4. moshu
    Member
    Posted 6 years ago #

    Next you want to exclude the category from the category list, which (I think) can be done with a plugin.

    Or, better yet, using the proper parameter (exclude) in the template tag.

  5. Roy
    Member
    Posted 6 years ago #

    Yes, but that's in a widget in most cases...

  6. Xavier Borderie
    Member
    Posted 6 years ago #

    Moshu : yup, I tried that one but indeed, it doesn't make it "public", it seems you really have to enter the category's URL in order to read its content. It does display months that have verbotten-only posts, but once you click that month, it gives the 404-finger :)

    I guess I'll stick to it anyway for now, but I might have to apply my theme-editing idea, which is just what Gangleri said.

    Thanks guys!

Topic Closed

This topic has been closed to new replies.

About this Topic