WP – Category Visibility Plugin for 2.3.x

UPDATE : Richard Hamilton has begun developing the plugin again and has a beta for 2.8.x available

I was using Category Visibility plugin created by Rich Hamilton – Run Your Own Website. When he ended support for WordPress v. 2.3.x. I then started work on fixing the patched version offered by Projekt Seven, formerly www.tastycornbread.com, who had took the work done by Rich and made the List functionality operable. When his site disappeared I decided to make my improvements available to the world. Enjoy!!

The main purpose of this plugin, as I see it, is to give more control over what categories are seen and where. It is highly usefully in using WordPress as a CMS (Content Management System.) Especially if a non-technical person is doing the content management. It works wonders in tandem with the Event Calendar plugin.

Unchecking “Front” and “List” keeps the calendar posts off the home page, and the listing off the sidebar. Since the event calendar is already in the sidebar this would just be a duplication of content.

This version was created with WordPress 2.3 specifically in mind. If using previous version please visit my predecessors Category Visibility (Keith McDuffee) which was written for WordPress 1.5 and ‘Category Visibility’ Plugin for WordPress 2.0.x (Rich Hamilton).

Instructions

  1. Simply download and unzip it.
  2. Put it in your plugins directory.
  3. Activate it.
  4. Go to “Manage (Posts, 2.7),” “Category Visibility” to see the visibility settings for all categories. the options are
    • Front: Posts show up on the main (home) page.
    • List: Categories that will show up in the List of categories in the sidebar.
    • Search: Posts show up in search results.
    • Feed: Posts show up in the main RSS/Atom feed.
    • Archive: Posts show up in archive links (i.e., clicking on the calendar links)

    Everything is checked to show up by default.

When you have a category to exclude from the front page, or the sidebar, etc., go to “Manage,” “Category Visibility,” and unselect the areas where you want the category to disappear.

This method is not designed as a security device, only as a display method. A guest can still access a post by post number.

Download

Category Visibility Plugin

Latest version, WP 2.3.x: Ver. 1.0.8.

Fixes:

  • 2.7 compatibility

Working on for version 2:

  • Separate Link, Post, and Tag Administration
  • WP 2.5 2.7 adaptation
  • Creating Tags administration to work in tandem with WikiLinks plugin
  • Add security element in tandem with WpDirAuth plugin

105 thoughts on “WP – Category Visibility Plugin for 2.3.x”

  1. Work great if a post is only in one category but I need to exclude posts that are part of more than one category.

    Is there any chance of including this capability in the new version?

    In any event, thanks for your work.

  2. Maybe I’m stupid, but I cannot find the “Category Visibility” settings in my WP2.7 Dashboard. Of course the plugin is active.

    I don’t see the Manage section ( as described above ) but I suppose that changed to Settings in WP2.7 ? At least at the place other panels of other plugins show up.

    Were is the category visibility hidden in WP2.7 ??

  3. Hi

    I have been trying to use this plugin with 2.7 and when I change the user level number this does not make any difference. What to set it so some cats are only avaliable for admin users.

    Am I doing something really silly?

    Abi

  4. Many thanks for keeping this plugin alive. Using this plugin with WP2.7 with only two problems:

    1. If a category name contains an apostrophe, it will not appear on the sidebar. Instead of removing the apostrophe in a category, I changed it to ’ (right single quote). To allow apostrophes in a category name, I’m guessing that if a part of the coding below “cv_alter_vis_catlist ($thelist)” uses quotation marks instead of apostrophes, it might allow category names containing apostrophes. Which section would that be? OR is there a way to cause an apostrophe to change into a character entity using htmlentities or perhaps wp_specialchars??? (I only know enough about php to get myself in trouble)

    2. If a parent category is removed from showing on the sidebar but a child of that parent is allowed, it causes a coding error in the sidebar. (The parent that was removed was the category that had the apostrophe)

  5. I, too, am seeing the problem that the user level does not seem to effect the front page listings. If they are checked, they show for everyone. If it isn’t, it shows up for no one. I think it is a bug.

  6. hi, great work!

    i mentioned a bug in cooperation with the events calendar-plugin in the sidebar: when acessing an category archive, the sidebar-widget of events calendar adds an database error like this:

    WordPress database error: [Unknown column ‘wp_term_taxonomy.term_id’ in ‘on clause’]
    SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts LEFT JOIN wp_cat_visibility ON (wp_term_taxonomy.term_id = wp_cat_visibility.cat_ID) WHERE 1=1 AND wp_posts.post_type = ‘post’ AND (wp_posts.post_status = ‘publish’) AND ((wp_cat_visibility.archives=1 AND wp_cat_visibility.cv_user_level<=0) OR post_status=’static’ OR wp_cat_visibility.cat_ID IS NULL) ORDER BY wp_posts.post_date DESC LIMIT 0, 5

    actually this error does NOT appear, if you acces the front-page.

    i am running WP2.7, VC is 1.0.8, EC 6.5.2.1 … have you got any idea?

  7. Will this plugin noindex the posts so that they do not appear in search engine search results?

    Is this possible?

    thx!

  8. I would love to use your plugin on my site, but it breaks my category feeds. Do you have any idea how I might fix this, or will this be fixed in your next release?

  9. I unticked one category I dod not want on my front page [using 2.7]

    …and everything disappeared from my front page

    Pls explain how I can restrict it just to the categories I do not want displayed

    Henry

  10. Hi, thanks so much for the plugin. After lots of searching around, your plugin seemed the best and it works on WP 2.7 too.

    However, I’m getting the same error as alosius where there’s a database error that keeps appearing on the sidebar everywhere except the front page of my site.
    WordPress database error: [Unknown column ‘wp_term_taxonomy.term_id’ in ‘on clause’]… and so forth.

    Any idea what’s wrong/how to fix this?
    Thanks,
    Brad

  11. Hi, not using yet but about to, and would like to add my support for any support for 2.7 / future releases. Or at least a point in the right direction to any other plugin with features similar to Rich’s 🙂

  12. Very useful plugin, thanks a lot.

    I noticed that it causes the Recent Posts widget to disappear or show as empty on Archive pages.

    For instance, you can see it happening on this very site:
    http://www.ipeat.com/?cat=1

    The Recent Posts widget is gone on the archive pages.

    Is this a bug or a feature? And is there any way to fix it?

  13. since i’ve installed your plugin (wpmu), i can no longer find posts with a specific tag. when i click any of the tags on a post page, it will not find posts using this tag. it only works after disabling your plugin. i’m using your plugin only to disable the listing of a single (seldomly used) category. the problem happens with all categories!

  14. Can you give an indication if any work is being done (or planned) for this plugin? I don’t see any responses to the recent bug reports.

    Thanks.

  15. I’m not sure if it is a bug but when I activate this plugin, most of my tag links no longer work. It just points to a 404 error page. When I deactivate it, it works fine again. Could this be fixed or am I doing something wrong?

  16. Having trouble with category RSS feeds showing up. Had another bug that prevented tags from properly linking,if that tag did not have matching category(even if empty) the tags would link to 404 not found. But this is preventable easiest fix was to create categories for each tag that I use and just don’t use the categories and make them not show up in category list. But the RSS feed for categories I need to have working. Right now the use of your plug-in outweighs the good over the bad, but I would eventually need to have the feeds working besides on my main feed. I also had the problem with multiple categories per post making not show all over. I use multiple tags and limit category to only one. No use in redundancy. This is fine with me.

  17. I love this plugin. However, we have a problem, when we activate it. Our tag slugs generate 404’s!

    Any suggestion for a work-around or fix?

    Thanks,

    Chuck

  18. Oops, I see Tom above had the same issue. If it helps, I notice that the tag slugs created AFTER the install of the plugin do work ok… just the ones create before the plugin install generate the 404 errors.

  19. Love this plugin, but I have the same problem with straight apostrophes in a Category Name causing that category to disappear in the sidebar widget. If I use “Kenneth’s Blog (curly)” instead of “Kenneth’s Blog” (straight), then it shows up, so that’s my solution for now, but hope there’s an update soon! WP 2.7.1, Category Visibility 1.0.8

  20. cat vis 1.0.8
    I am having a problem with tags. If you click on a tag then even when there are posts that use this tag they will not show up unless you create a matching category. so link http://www.juanitachronowski.com/jdcblog/?tag=funding will not work as I have no category called funding to match but http://www.juanitachronowski.com/jdcblog/?tag=detroit will work because I created a category called detroit. It does not matter if the category has posts that use it or even if you choose to list the category only that it is there at all. So I don’t want hundreds of categories if I use hundreds of keywords(tags). How can I fix this? This is a great source of headache.

    Is there a newer version 1.0.8 is latest on WP.org

  21. Have the same problem as Juanita, when include the plugin do not display results for the tag.
    Wordpress 2.7, Category Visibility-iPeat Rev 1.0.8.

  22. I fixed your plugin that caused the category RSS feeds not to work (small fixes I should say, but they make the difference).

    I running on wordpress 2.8 and I am pretty sure the fix is very generic. If you are interested on getting a copy of my modified version, just PM me at philibert *at* 1geek1tool *dot* com

  23. I have the same issue as Juanita and Alexander on WP 2.8 and 2.8.1

    I have not tried adding a category as Juanita did to see if it would enable a specific tag with the same name, though I agree doing so is not a real solution.

  24. This plugin disables the new taxonomies feature.

    It also makes trouble with tags.

    I disabled the plugin until the author can fix this bug.

  25. To fix the tag bug:

    change line 263 to:
    elseif (is_category())

    and line 265 to:
    elseif (is_archive() && (!is_category() && !is_tag()))

  26. When i activate the plugin all the most from my index page disappear….I would still like to use the detault page but just take some of the post off that are in certain catagories.. How do i do this??? email me please

  27. This plugin does not work for me on a WP 2.8.4. site. When I enable this and execute this query:

    new WP_Query(‘cat=28&posts_per_page=1000000’);

    I get this error:

    [Not unique table/alias: ‘wp_term_relationships’]
    SELECT SQL_CALC_FOUND_ROWS wp_posts.*
    FROM wp_posts
    INNER JOIN wp_term_relationships ON
    (wp_posts.ID = wp_term_relationships.object_id)
    INNER JOIN wp_term_taxonomy ON (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id)
    LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id)
    LEFT JOIN wp_term_taxonomy ON (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id)
    LEFT JOIN wp_cat_visibility ON (wp_term_taxonomy.term_id = wp_cat_visibility.cat_ID)
    WHERE
    1=1 AND wp_term_taxonomy.taxonomy = ‘category’ AND wp_term_taxonomy.term_id IN (’28’, ‘1’, ‘5’, ‘4’, ‘6’, ‘7’, ‘8’, ‘2’, ‘3’, ‘9’) AND wp_posts.post_type = ‘post’ AND (wp_posts.post_status = ‘publish’ OR wp_posts.post_status = ‘private’) AND wp_term_taxonomy.taxonomy=’category’ AND (wp_cat_visibility.front=1 OR post_status=’static’ OR wp_cat_visibility.cat_ID IS NULL)
    GROUP BY wp_posts.ID wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 1000000

  28. Pingback: jeffwarren.org
  29. Can anyone tell if this plugin noindex the posts/categories so that they do not appear in search engine search results? will Google see these categories?
    It is importent…
    Thanks

  30. If the category name contain single quote (‘) or double quote (“), the category will be hidden. Could you fix it? Thanks.

  31. Nice Plugin.
    On My website anyway once actived won’t allow anymore main menu to show correctly: Subcategory are shown at the same level of parent category. Do You have any idea of the problem?

    Tks

Leave a Reply

Your email address will not be published.