I was using an old Wordpress hack called Show Categories to get around the problem of my not wanting all posts of certain categories showing up on the front/main page. It worked…somewhat. But there were things it didn’t work on, such as feeds and sometimes searches and archive links. There are additional hacks I could do to fix that, but I thought instead that perhaps a new plugin was in order.
This plugin, which is very much in beta, only works in WordPress 1.5+. It adds a new menu link under the “Manage” admin menu titled “Category Visibility”. Once you activate the plugin, go to this menu and you’ll see the visibility settings for all categories. So far I’ve listed options for “Front”, “List”, “Search”, “Feed” and “Archives”, defined as:
- Front: All posts in the category will not show up on the main page
- List: The category will not show on the list of categories on the home page (i.e., the list in the sidebar here)
- Search: The category’s posts will not show up in search results
- Feed: The category’s posts will not show up in the main RSS/Atom feed
- Archive: The category’s posts will not show up in archive links (i.e., clicking on the calendar links)
I did not get a chance to test with inherited categories, so if that breaks let me know. I may get around to testing that sometime.
You can grab the latest version here (Version: 0.31)
NOTE: If you’re using the default download of Wordpress version 1.5 (i.e., NOT 1.5.1 or above) download the version here. There’s a database change made in the nightlies that made this necessary for now.
IMPORTANT: As of version 0.28, these versions will create a new table and not use your existing one, so write down the current values if you’re using an older version of this plugin before installing and running this version!
To Do:
- Put this plugin on WP-Plugins.org (in progress)
- Allow per-post visibility option. Should be as simple as adding a custom field for posts.
- Fix issue with number of posts on front page when some are marked to not show up (i.e., you specify 10 posts per page, two of those are marked not to show on the front page, so you instead only see eight posts)
March 8, 2005
Horaayy..there are 171 comment(s) for me so far ;)
Nice work.
Hi, I tried the plugin but with the following error.
1. when i click on the Category Visibility under Manage, i got the 404 error saying that “mysite/wp-admin/5150″ was not found.
2. The “WordPress database error: [Table 'mysite_wordpress.cat_visibility' doesn't exist]
SELECT cat_ID from cat_visibility” shows up in Manage–>Posts
Do i need to create the table ? Or it should be automatic created that table?
Hi,
I get this error message:
404 Not Found
The requested URL /blog/wp-admin/5150 does not exist.
/blog/ is the directory containing my Wordpress 1.5 install
Try the new version I must put up (version 0.10).
maybe some possible future features would be checking for user lvl? b4 deciding whether to show the post in the category??
nice plugin though. really useful
Still no go:
404 Not Found
The requested URL /wp-admin/plugins/category_visibility.php does not exist.
The plugin is in /wp_content/plugins
Yes, i got the same error as Charlie.
And the database problem still remain:-
WordPress database error: [Table 'mysite_wordpress.cat_visibility' doesn't exist]
SELECT cat_ID from cat_visibility
Hope you could figure it out when you are free.
Are you using Wordpress 1.5? Maybe it’s because I’m using 1.5.1-alpha, but I don’t think that’s it…
Another to report the same problems as 6 and 7. Using Wp1.5. I haven’t tried it on my nightly build yet.
Ian — Can you try on your nightly please? I’m following what I’ve seen in other plugins, so it’s not clear what’s wrong. The database problem should go away once we get the page to load up ok.
function category_vis_menu () {
add_submenu_page(‘edit.php’, ‘Category Visibility’, ‘Category Visibility’, 9, basename(__FILE__), ‘category_visibility’);
}
doing this will do. and will get rid of all the 404 errors
So after i managed to get rid of the 404, everything loads nicely into the SQL table. but when i try to save changes, i get the error
Cannot load 5150.
looking at the code. what’s a 5150 page?
TedFox — That was how I was calling the script back in the form. I guess now I need to figure out what to slip into the “action=” part of the plugin.
OK try the latest version I just put up (version 0.12).
I’m trying version 0.14 and getting the same 404. It seems to be looking for wp-admin/plugins/category_visibility.php. Should it be looking in wp-content instead?
sorry, think then talk. It was my upload problem.
0.14 works perfectly for me now. Excellent idea. I was doing all kinds of things with the loop and various plugins to get this functionality, but this solution is clean and elegant.
v0.14 works for me. Awesome! Really great plugin.
OK. It’s working, but there is a conflict with the plugin wp-wiki
http://bakerstreetsystems.co.uk/WpWiki
If I choose to hide anything which is in the wiki category from the front page, I get a 404 error when I click the permalink. If the post is on the front page, I click and it is fine. My permalinks are set in the format http://www.mysite/postname
Hope you can help!
This works now ( v.14), but when I activate the plugin and view the page, the number of database queries jumps from 40 to over 500. This happens both on my main and test blogs, and drops back down if I turn off the plugin.
Hm… I bet I can get that number down. I’ll work on it tonight.
How would I go about create a page in a sub directory for a specific category. For example, I want to be able to mark posts in a “private” category and then put that under /wordpress/private, secured using .htaccess. How would I go about doing this — from what I can tell this plugin only impacts the main frontpage? Thanks, sorry if this is vague I need to catch up on the possabilities a bit more …
This plugin looks interesting, and I’d like to extend it and test it, since cat visibility can allow for many other powerful plugins.
Would you mind formally slapping a license on it? I’d like to get into the code, but don’t feel comfortable working on something without one. You’ll need one anyways if you want to toss it into wp-plugins.org
Best,
~Tor
Tor — License added to the comments of the plugin. Please let me know what you wind up doing with it. I do want to lessen the number of database accesses, which I believe is due to the category list functionality.
It won’t works for the sub-category under a parent? After i activated for the sub-category to “not showing on frontpage only” (it works for this function), but clicking on the sub-category list, the archive page for that category shows up with errors.
another problem, if a search with 0 results, i’ll get this:
Warning: Invalid argument supplied for foreach() in /mysites/category_visibility.php on line 184
Any ideas?
Cara — I fixed the 0 results problem in version 0.15. I haven’t had time to check out subcategories yet. Sorry.
Hi, it works perfectly. Thank you. I really appreciate your help in solving this problem.
As for the sub-categories, it’s ok, i’ll wait patiently.
Btw, you forgot to update the version no. in your post.
Just want to point out, if you are using wpPaginate Plugin from Scriptygoddess while using the Category Visibility Plugins, there will be some problems with the page numbers.
At least currently, it won’t show my last page (appear as 9 pages but actually should be 10 pages) thus my 1st few posts never shows up.
I know nothing abt scripts, just want to point out the conflicts.
I fixed another issue where this plugin was affecting what was listed in the admin management panel. Oops. Fixed now in 0.16.
This is a great plugin that I would like to use for a site I am developing, but it has a glitch. It seems to still count the posts that are hidden from the front page in the total for the posts per page value. For example, if I had set WP to didplay 5 posts per page, and have my 5 most recent posts in a category that is not shown on the front page, I get a Sorry no posts found, until I click on the “next page” link.
I have solved my problem with Ryan’s front-page-cats. plugin, but would prefer to use your more elegant solution…
Philip — I see what you mean. Unfortunately it looks like it may take more coding that I have time for right now to fix that, but I’ll keep looking at it.
Great! I’ll keep my eye out for updates!
I agree with TedFox that it would be an even more fantastic addon if you could tie it to user levels. Seems a logical thing to do, but no one does it. And unfortunately it is beyond my abilities to hack it.
I’m very interested in an update to this plug-in. Can we get an update on its status. It is looking like it will be very cool.
I have a wish feature.
How about when you hide a category and its posts on the front page, it hides that category and its posts. Fine.
But, how about if you hardlink a category (say a link in the header with a direct link to the category) that is hidden, it will still show a list of the posts in that category when you click the link? Right now, it just permanently hides the posts, but I need them still visible on a different page.
Does that sound do-able?
This sounds similar to what I’m looking for.
I have a category called WordPress that contains posts on plugins that I’m using or updates to the core software. I don’t really want these posts displayed on the front page or syndicated in RSS, but I’d still like people to be able to view them by clicking on the WordPress link in the Categories list.
As it is now, if I hide a category from the front and RSS, and click on it in the category list, I get the message “Not Found”.
Rich — What you’re doing really should work – it works for me here (see the category “Photos”). Do you have the checkmark for “Archive” checked for your “Wordpress” category?
OK guys, try the latest version now (0.18).
This works pretty good, not on inherited categories tho.
Try the latest version 0.21 for support with children categories. It’s not working for children of children, etc., but it should work if you’re only making single sub-categories and not sub-sub-categories. Sorry if that sounds confusing. Also made some improvements with the number of database lookups (I know that’s an issue for some people).
I have the latest version.
I have checked everything except FRONT in my catagory vis.
I access the catagory and receive this error
Sorry, no posts matched your criteria.
Does anyone else get this:
1) after this plugin is enabled…
2)… if new categories are defined…
3).. the blug in has to be deactivated/activated again to see the new cats?
t
There seems to be a conflict when both the WP-Googlestats and this plugin are activated. It works fine when activated alone, but when the WP-Googlestats plugin is also activated, clicking on “Category Visibility” or “Googlebot” under the “Manage” menu brings up the WP-Googlestats plugin. This is weird. I try manually entering /wp-admin/edit.php?page=category_visibility.php and it still brings up the WP-Googlestats page. Any Ideas?
Does your code use the wordpress database as having “wp_” prefix? Or does it use the wordpress’s global variable $wpdb? My wordpress database’s prefix is not “wp_”. I had to change it as I have more than one wp running on same db. Perhaps that could be why I’m stil getting the errors #2 ( comment ) states?
Hi,
I tried to use this and I have the issue where my WP site is looking for a table in the database. Am I supposed to run something to have the table created first?
Thanks,
md
Hey man – great plug-in … However, I had problems when I would use it with multiple installs of WP in one database – so, thanks to the help of the WP forums, I tweaked the code slightly (just by adding the $wpdb before each call to the table, so it creates a table with the wp_ (or whatever you set if for) prefix, which I think will eliminate the bugs I was having – which I’m pretty sure were only happening in databses with multiple installs … anyway, I’ll be happy to post it, email it to you, leave it for you to download, whatever – it’s your plug-in and all, so I figured I would just pass it on to you … (just a note, though – if you already have a table named cat_visibility, I had to drop it until the plugin would create the table – after that though, worked like a charm … and who knows, maybe even that is a quick and easy fix, it’s just beyond me, so … )
cat_visibility = $table_prefix . 'cat_visibility';
function category_vis_menu () {
add_submenu_page('edit.php', 'Category Visibility', 'Category Visibility', 9, basename(__FILE__), 'category_visibility');
}
function category_visibility () {
global $wpdb;
if($wpdb->query("CREATE TABLE IF NOT EXISTS $wpdb->cat_visibility (
cat_ID bigint(20) UNIQUE,
front int(4) NOT NULL default 1,
list int(4) NOT NULL default 1,
search int(4) NOT NULL default 1,
feed int(4) NOT NULL default 1,
archives int(4) NOT NULL default 1
)"));
?>
3 ) : ?>
" method="post">
Front: Visibility on the front/main page.
List: Visibility on the list of categories on the home page.
Search: Visibility in search results.
Feed: Visibility in RSS/RSS2/Atom feeds.
Archive: Visibility in archive links (i.e., calendar links).
" />
get_results("SELECT * FROM $wpdb->categories ORDER BY cat_name");
if ($categories) {
foreach ($categories as $category) {
if ($category->category_parent == $parent) {
$category->cat_name = wp_specialchars($category->cat_name);
$pad = str_repeat('— ', $level);
if ( $user_level > 3 ) {
$catvis = $wpdb->get_results("SELECT * FROM $wpdb->cat_visibility WHERE cat_ID=$category->cat_ID LIMIT 1");
$catvis = $catvis[0];
if ($catvis->front == 1 || $catvis == 0) $catvis_front = "checked"; else $catvis_front = "";
if ($catvis->list == 1 || $catvis == 0) $catvis_list = "checked"; else $catvis_list = "";
if ($catvis->search == 1 || $catvis == 0) $catvis_search = "checked"; else $catvis_search = "";
if ($catvis->feed == 1 || $catvis == 0) $catvis_feed = "checked"; else $catvis_feed = "";
if ($catvis->archives == 1 || $catvis == 0) $catvis_archives = "checked"; else $catvis_archives = "";
$edit = "Front: cat_ID . "_front' class='edit' type='checkbox' $catvis_front /> ";
$edit .= "List: cat_ID . "_list' class='edit' type='checkbox' $catvis_list /> ";
$edit .= "Search: cat_ID . "_search' class='edit' type='checkbox' $catvis_search /> ";
$edit .= "Feed: cat_ID . "_feed' class='edit' type='checkbox' $catvis_feed /> ";
$edit .= "Archives: cat_ID . "_archives' class='edit' type='checkbox' $catvis_archives />";
}
else
$edit = '';
$class = ('alternate' == $class) ? '' : 'alternate';
echo "$category->cat_ID$pad $category->cat_name
$edit
";
my_cat_rows($category->cat_ID, $level + 1, $categories);
}
}
} else {
return false;
}
}
function edit_cat_vis () {
global $wpdb;
if (!$categories)
$categories = $wpdb->get_results("SELECT cat_ID FROM $wpdb->categories");
if ($categories) {
foreach ($categories as $category) {
$front = $category->cat_ID . "_front";
$list = $category->cat_ID . "_list";
$search = $category->cat_ID . "_search";
$feed = $category->cat_ID . "_feed";
$archives = $category->cat_ID . "_archives";
if ($_POST["$front"] == "on") $front = 1; else $front = 0;
if ($_POST["$list"] == "on") $list = 1; else $list = 0;
if ($_POST["$search"] == "on") $search = 1; else $search = 0;
if ($_POST["$feed"] == "on") $feed = 1; else $feed = 0;
if ($_POST["$archives"] == "on") $archives = 1; else $archives = 0;
$wpdb->query("REPLACE INTO $wpdb->cat_visibility SET cat_ID=$category->cat_ID, front=$front, list=$list, search=$search, feed=$feed, archives=$archives");
}
}
}
function alter_vis_posts ($posts) {
global $wpdb, $wp_query;
global $pagenow;
/* If no posts for the selection, just return */
if (!$posts)
return;
/* If we're in the admin menu, return unfiltered */
if ($pagenow == 'edit.php')
return $posts;
/* If table is empty, show all for now */
if(!$wpdb->get_results("SELECT cat_ID from $wpdb->cat_visibility"))
return $posts;
$visposts = array();
$q = $wp_query->query_vars;
/* Check if the category page itself should show posts */
if (isset($q['category_name'])) {
$cat_nicename = rtrim($q['category_name'], "/");
$cats = $wpdb->get_results("SELECT cat_ID FROM $wpdb->categories WHERE category_nicename='$cat_nicename' LIMIT 1");
if($cats) {
foreach ($cats as $cat) {
$thiscat = $cat->cat_ID;
}
}
if($wpdb->query("SELECT cat_ID FROM $wpdb->cat_visibility WHERE cat_ID=$thiscat AND list=1"))
return $posts;
else
return;
}
/* Check if archived pages should show posts */
if(isset($q['year'])) {
foreach ($posts as $post) {
$categories = get_the_category($post->ID);
$visible = 0;
foreach ($categories as $category) {
if($wpdb->query("SELECT cat_ID FROM $wpdb->cat_visibility WHERE cat_ID=$category->category_id AND archives=1"))
$visible = 1;
}
if ($visible == 1)
array_push($visposts, $post);
}
return $visposts;
}
/* Check if search results should show posts */
if (isset ($q['s'])) {
foreach ($posts as $post) {
$categories = get_the_category($post->ID);
$visible = 0;
foreach ($categories as $category) {
if($wpdb->query("SELECT cat_ID FROM $wpdb->cat_visibility WHERE cat_ID=$category->category_id AND search=1"))
$visible = 1;
}
if ($visible == 1)
array_push($visposts, $post);
}
return $visposts;
}
/* Continue with front page */
foreach ($posts as $post) {
$visible = 0;
if($categories = get_the_category($post->ID)) {
foreach ($categories as $category) {
if(isset ($q['feed'])) {
if($wpdb->query("SELECT cat_ID FROM $wpdb->cat_visibility WHERE cat_ID=$category->category_id AND feed=1")) {
$visible = 1;
}
} elseif ($wpdb->query("SELECT cat_ID FROM $wpdb->cat_visibility WHERE cat_ID=$category->category_id AND front=1")) {
$visible = 1;
}
}
} else
$visible = 1;
if ($visible == 1)
array_push($visposts, $post);
}
return $visposts;
}
function alter_vis_catlist ($thelist) {
global $wpdb;
/* If table is empty, show all for now */
if(!$wpdb->get_results("SELECT cat_ID from $wpdb->cat_visibility"))
return $thelist;
if (preg_match("/href/", $thelist)) {
$newlist = "";
$linklist = preg_split('//', $thelist);
foreach ($linklist as $link) {
$thiscatname = preg_replace("/\s+\]*)?\>/", "", $link);
$thiscatname = preg_replace("/\.*/s", "", $thiscatname);
$cats = $wpdb->get_results("SELECT cat_ID from $wpdb->categories WHERE cat_name='$thiscatname' LIMIT 1");
if ($cats) {
foreach ($cats as $cat) {
$thiscat = $cat->cat_ID;
}
if($wpdb->query("SELECT cat_ID FROM $wpdb->cat_visibility WHERE cat_ID=$thiscat AND list=1"))
$newlist .= $link . "\n";
}
}
return $newlist;
} else {
$thiscatname = $thelist;
}
$cats = $wpdb->get_results("SELECT cat_ID from $wpdb->categories WHERE cat_name='$thiscatname' LIMIT 1");
if ($cats) {
foreach ($cats as $cat) {
$thiscat = $cat->cat_ID;
}
if($wpdb->query("SELECT cat_ID FROM $wpdb->cat_visibility WHERE cat_ID=$thiscat AND list=1"))
return $thelist;
else
return;
} else {
return $thelist;
}
}
add_action('admin_menu', 'category_vis_menu');
add_filter('the_posts', 'alter_vis_posts');
add_filter('list_cats', 'alter_vis_catlist');
?>
Arrgghh – sorry for the lengthy, weird looking posts – feel free to delete them, I was just trying to post the code in here for you … sorry …
This is sort of working, but I get these error’s in the admin section:
Warning: Cannot modify header information – headers already sent by (output started at /home/gr3909/public_html/articles/wp-content/plugins/category_visibility.php:293) in /home/gr3909/public_html/articles/wp-admin/admin.php on line 6
Warning: Cannot modify header information – headers already sent by (output started at /home/gr3909/public_html/articles/wp-content/plugins/category_visibility.php:293) in /home/gr3909/public_html/articles/wp-admin/admin.php on line 7
Warning: Cannot modify header information – headers already sent by (output started at /home/gr3909/public_html/articles/wp-content/plugins/category_visibility.php:293) in /home/gr3909/public_html/articles/wp-admin/admin.php on line 8
Warning: Cannot modify header information – headers already sent by (output started at /home/gr3909/public_html/articles/wp-content/plugins/category_visibility.php:293) in /home/gr3909/public_html/articles/wp-admin/admin.php on line 9
Can someone please clue me in as to how to fix that? I REALLY need to get this thing to work, thanks!
-Pickled
I don’t get any errors using the plugin.. however, when i select a catagory on the menu which i have set as not to show on the main page, i’m told that there are no posts at all under that catagory. It seems to be compleatly filtering out everything that i don’t have showing on the front page.
Any updates related to comments #30/31 above?
Pickled – You likely have blank space at the beginning or end of your plugin codebefore or after th php opening or closing tags…delete that and you should be good to go.
so when i click on one of my categories that are set not to be visible on the main page (in other words – specifically selecting this category to see it’s posts) i get “sorry no posts matched your criteria” or some similar thing….is this the intended functionality?
am i missing something with the edit.php? and is the link for the plug-in for the category_visibility.php only or is the edit.php code in there as well, or am i not reading it through all the way…
very useful plugin. One thing I noticed is that invisible posts are still factored in to the ‘posts per page’. If I want 20 posts per page and 5 of them are invisible – only 15 will show up on the front page. I’m pretty sure, I mean, should test more extensively.
To the people that are commenting on the “sorry no posts matched your criteria” message when selecting a hidden category…
I experienced the same behavior with this plugin. The solution was to enable permalinks. Once I did that it seemed to work as it should.
The problem, however; is that enabling permalinks disabled some other functionality that I can’t live without, so I had to disable permalinks and discontinue my use of this plugin. I’m still hoping this will be resolved some day.
I activated your plugin but it seemed to be unable to create the database, so I copied the query from the code and manually created it. Now when I activate it I see this error (ten times!) on the front page:
WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND front=1' at line 1]
SELECT cat_ID FROM cat_visibility WHERE cat_ID= AND front=1
and no posts at all, only the Not Found page, though I didn’t choose to hide any category.
Maira — ARe you using the latest development version of WP? I saw the error too, but it just started recently. It’s fixed in 0.25, but I’m hoping it won’t break anyone not using the development checkout of WP.
Announcing Auto-TrackBack by Category Plugin for WordPress 1.5
Here’s a little nugget for WordPress users. If you subscribe to a TrackBack aggregator like AustinBloggers, they want you to TrackBack all the posts you make that are relevant to that site, so that they can collect them for their audience. You can s…
True, I’m using one of the nightlies, I’m sorry I forgot to tell you. I installed the last version of your plugin (0.26) and that error dissappeared; however, I am unable to see the categories I hide from the front page though I have all the other options checked; if I click on their link or on the archives all I get is the not found page. The search is working, though.
I’d love to have your plugin up and running, it’s something I’ve been looking for so long and yours is really complete. I specially like the user level option, which makes it very flexible. Many thanks for creating this and also for your support.
Another issue: i have one category invisible on the front page, all other options checked and user level set ot 1, but I can’t see its posts though I’m logged as admin. Tried with inherited categories and new (test) ones.
Well, I’ve tested what you say you have set, and it works for me. The fact you’re using nightlies doesn’t help, though. Try making sure you keep updated as it may be a bug you haven’t had fixed yet.
I get the following error repeatedly when i try to uncheck a setting:
WordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1]
REPLACE INTO wp_cat_visibility SET cat_ID=1, front=1, list=1, search=1, feed=1, archives=1, user_level=
Ideas?
Try the latest code.
.27 the error isnt appearin on the options page, but now it appears on my site a whole bunch of times, to teh exclusion of all content
WordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ‘AND front=1 AND user_level
OK, try .28.
Sorry..same error.
I get the same problem. Could it have something to do with subcategories?
In line ~238 the resulting SQL query is:
“SELECT cat_ID FROM wp_cat_visibility WHERE cat_ID= AND front=1 AND user_level cat_ID is empty.
Firstly, I’m using WP 1.5 and the latest version of the Visibility plugin.
When I upload the plugin file, it has an extension of .phps. When the file extension is left alone, the plugin DOES NOT show up in the list of available plugins. If I rename is to .php, it then shows up and allows me to activate it.
When I activate it, I get the following errors on the main page of my blog:
WordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ‘AND front=1 AND user_level
Firstly, I’m using WP 1.5 and the latest version of the Visibility plugin.
When I upload the plugin file, it has an extension of .phps. When the file extension is left alone, the plugin DOES NOT show up in the list of available plugins. If I rename is to .php, it then shows up and allows me to activate it.
When I activate it, I get the following errors on the main page of my blog:
WordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ‘AND front=1 AND user_level
Please try version 0.29 and let me know if that works. It should default to user_level being zero…
No change with .29….
Hello. I installed the plugin but i receive the following error when i load the home page:
WordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ‘AND front=1 AND user_level
It seems cat_ID is not delivered in the struct response from “get_the_category” (any more?) [I'm a newbie at this]. I tried replacing cat_ID with category_id in the lines 239 and 242 (v.29) and it worked like a charm. Now, I have no appreciation for the detailed workings of this script and maybe I introduce something really bad by making this change . I’d appreciate an expert opinion.
“cat_ID” seems to be a change in the Wordpress nightlies. I made that change so it would continue to work for me, though in the process I may have messed things up for anyone still using version 1.5 — sorry about that. My guess with the problems people are having with the MySQL error is the line with ” AND user_level” in the code is getting chopped off, as the full line is ” AND user_level
Hi, this is an excellent idea. I intend to use it in relation to the email publish option to allow users to email in their comments. But, to prevent spam posts, I want to use this to keep the Category off the frontpage.
I am using version 0.29 of the plugin and WP version 1.5. It was a clean install a few days ago.
I get the same error which has plagued everyone else and having read through the responses, there doesn;t seem to be a solution as yet. CAn you help?
WordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ‘AND front=1 AND user_level
Please try version 0.30. I’m sort-of winging it here, since this works fine for me. I took some whitespace out that may be causing the problem.
Still no joy.
Same error.
I’m on WP 1.5 and CV 0.30.
I got rid of my SQL errors by doing s/$category->cat_ID/$category->category_id/ inside alter_vis_posts().
But then still won’t work. $user_levels is not set up correctly in alter_vis_posts(). It’s always NULL – whether I’m logged in or not. Does anyone else have the same problem? Or a clue to what’s going on?
I looked up $user_level in in alter_vis_catlist() and there it /is/ properly set up.
Please remove my comment spam above. Sorry about that
Well, here is the patch that gets 0.30 going on 1.5 for me.
--- category-visibility.php.old 2005-05-08 00:47:02.000000000 +0200
+++ category-visibility.php.new 2005-05-08 00:48:34.000000000 +0200
@@ -165,0 +166 @@
+ get_currentuserinfo();
@@ -208 +209 @@
- if($wpdb->query("SELECT cat_ID FROM $cat_visibility WHERE cat_ID=$category->cat_ID AND archives=1 AND user_levelquery("SELECT cat_ID FROM $cat_visibility WHERE cat_ID=$category->category_id AND archives=1 AND user_levelquery("SELECT cat_ID FROM $cat_visibility WHERE cat_ID=$category->cat_ID AND search=1 AND user_levelquery("SELECT cat_ID FROM $cat_visibility WHERE cat_ID=$category->category_id AND search=1 AND user_levelquery("SELECT cat_ID FROM $cat_visibility WHERE cat_ID=$category->cat_ID AND feed=1")) {
+ if($wpdb->query("SELECT cat_ID FROM $cat_visibility WHERE cat_ID=$category->category_id AND feed=1")) {
@@ -242 +243 @@
- } elseif ($wpdb->query("SELECT cat_ID FROM $cat_visibility WHERE cat_ID=$category->cat_ID AND front=1 AND user_levelquery("SELECT cat_ID FROM $cat_visibility WHERE cat_ID=$category->category_id AND front=1 AND user_level
I think I found a fix for your code. Looks like the get_the category function is not returning an data. I wrote a function in the top of your script to search the wp_post2cat table directly and changed the $category->catID lookups to $category->category_id..
get_results("SELECT category_id from wp_post2cat where post_id = $postID");return $categories;
}
function category_visibility () {
global $wpdb;
global $cat_visibility;
global $user_level;
if (empty($user_level)) $user_level = 0;
if (!is_numeric($user_level)) $user_level = 0;
if($wpdb->query("CREATE TABLE IF NOT EXISTS $cat_visibility (
cat_ID bigint(20) UNIQUE,
front int(4) NOT NULL default 1,
list int(4) NOT NULL default 1,
search int(4) NOT NULL default 1,
feed int(4) NOT NULL default 1,
archives int(4) NOT NULL default 1,
user_level int(4) NOT NULL default 0
)"));
?>
3 ) : ?>
" method="post">
Front: Visibility on the front/main page.
List: Visibility on the list of categories on the home page.
Search: Visibility in search results.
Feed: Visibility in RSS/RSS2/Atom feeds.
Archive: Visibility in archive links (i.e., calendar links).
User Level: Visibility on user level basis. All users up to this level can see posts as checked. Does not affect feed visibility, obviously.
" />
get_results("SELECT * FROM $wpdb->categories ORDER BY cat_name");
if ($categories) {
foreach ($categories as $category) {
if ($category->category_parent == $parent) {
$category->cat_name = wp_specialchars($category->cat_name);
$pad = str_repeat('— ', $level);
if ( $user_level > 3 ) {
$catvis = $wpdb->get_results("SELECT * FROM $cat_visibility WHERE cat_ID=$category->cat_ID LIMIT 1");
$catvis = $catvis[0];
if ($catvis->front == 1 || $catvis == 0) $catvis_front = "checked"; else $catvis_front = "";
if ($catvis->list == 1 || $catvis == 0) $catvis_list = "checked"; else $catvis_list = "";
if ($catvis->search == 1 || $catvis == 0) $catvis_search = "checked"; else $catvis_search = "";
if ($catvis->feed == 1 || $catvis == 0) $catvis_feed = "checked"; else $catvis_feed = "";
if ($catvis->archives == 1 || $catvis == 0) $catvis_archives = "checked"; else $catvis_archives = "";
$catvis_user_level = $catvis->user_level;
$edit = "Front: cat_ID . "_front' class='edit' type='checkbox' $catvis_front /> ";
$edit .= "List: cat_ID . "_list' class='edit' type='checkbox' $catvis_list /> ";
$edit .= "Search: cat_ID . "_search' class='edit' type='checkbox' $catvis_search /> ";
$edit .= "Feed: cat_ID . "_feed' class='edit' type='checkbox' $catvis_feed /> ";
$edit .= "Archives: cat_ID . "_archives' class='edit' type='checkbox' $catvis_archives /> ";
$edit .= "User Level: cat_ID . "_user_level' class='edit' type='text' size='3' value='" . $catvis_user_level . "' />";
}
else
$edit = '';
$class = ('alternate' == $class) ? '' : 'alternate';
echo "$category->cat_ID$pad $category->cat_name
$edit
";
my_cat_rows($category->cat_ID, $level + 1, $categories);
}
}
} else {
return false;
}
}
function edit_cat_vis () {
global $wpdb;
global $cat_visibility;
if (!$categories)
$categories = $wpdb->get_results("SELECT cat_ID FROM $wpdb->categories");
if ($categories) {
foreach ($categories as $category) {
$front = $category->cat_ID . "_front";
$list = $category->cat_ID . "_list";
$search = $category->cat_ID . "_search";
$feed = $category->cat_ID . "_feed";
$archives = $category->cat_ID . "_archives";
$user_level = $category->cat_ID . "_user_level";
if ($_POST["$front"] == "on") $front = 1; else $front = 0;
if ($_POST["$list"] == "on") $list = 1; else $list = 0;
if ($_POST["$search"] == "on") $search = 1; else $search = 0;
if ($_POST["$feed"] == "on") $feed = 1; else $feed = 0;
if ($_POST["$archives"] == "on") $archives = 1; else $archives = 0;
$user_level = $_POST["$user_level"];
if (empty($user_level)) $user_level = 0;
if(!is_numeric($user_level)) $user_level = 0;
$wpdb->query("REPLACE INTO $cat_visibility SET cat_ID=$category->cat_ID, front=$front, list=$list, search=$search, feed=$feed, archives=$archives, user_level=$user_level");
}
}
}
function alter_vis_posts ($posts) {
global $wpdb, $wp_query;
global $pagenow;
global $cat_visibility;
global $user_level;
if (empty($user_level)) $user_level = 0;
if (!is_numeric($user_level)) $user_level = 0;
/* If no posts for the selection, just return */
if (!$posts)
return;
/* If we're in the admin menu, return unfiltered */
if ($pagenow == 'edit.php')
return $posts;
/* If table is empty, show all for now */
if(!$wpdb->get_results("SELECT cat_ID from $cat_visibility"))
return $posts;
$visposts = array();
$q = $wp_query->query_vars;
/* Check if the category page itself should show posts */
if (isset($q['category_name'])) {
$cat_nicename = rtrim($q['category_name'], "/");
$cat_nicename = array_pop(explode("/", $cat_nicename));
$cats = $wpdb->get_results("SELECT cat_ID FROM $wpdb->categories WHERE category_nicename='$cat_nicename' LIMIT 1");
if($cats) {
foreach ($cats as $cat) {
$thiscat = $cat->cat_ID;
}
}
if($wpdb->query("SELECT cat_ID FROM $cat_visibility WHERE cat_ID=$thiscat AND archives=1 AND user_levelID);
$visible = 0;
foreach ($categories as $category) {
if($wpdb->query("SELECT cat_ID FROM $cat_visibility WHERE cat_ID=$category->category_id AND archives=1 AND user_levelID);
$visible = 0;
foreach ($categories as $category) {
if($wpdb->query("SELECT cat_ID FROM $cat_visibility WHERE cat_ID=$category->category_id AND search=1 AND user_levelID)) {
foreach ($categories as $category) {
if(isset ($q['feed'])) {
if($wpdb->query("SELECT cat_ID FROM $cat_visibility WHERE cat_ID=$category->category_id AND feed=1")) {
$visible = 1;
}
} elseif ($wpdb->query("SELECT cat_ID FROM $cat_visibility WHERE cat_ID=$category->category_id AND front=1 AND user_levelget_results("SELECT cat_ID from $cat_visibility"))
return $thelist;
if (preg_match("/href/", $thelist)) {
$newlist = "";
$children = 0;
$linklist = preg_split('/\t/', $thelist);
foreach ($linklist as $link) {
if(preg_match("/class.*children/", $link)) {
$children = 1;
$newlist .= $link;
} elseif(preg_match("//", $link) && $children) {
$children = 0;
$newlist .= $link;
} else {
$thiscatname = strip_tags($link);
$thiscatname = preg_replace("/\s+\(\d+\)\s+/", "", $thiscatname);
$thiscatname = trim($thiscatname);
if(!empty($thiscatname)) {
$cats = $wpdb->get_results("SELECT cat_ID from $wpdb->categories WHERE cat_name='$thiscatname' LIMIT 1");
if ($cats) {
foreach ($cats as $cat) {
$thiscat = $cat->cat_ID;
}
if($wpdb->query("SELECT cat_ID FROM $cat_visibility WHERE cat_ID=$thiscat AND list=1 AND user_levelget_results("SELECT cat_ID from $wpdb->categories WHERE cat_name='$thiscatname' LIMIT 1");
if ($cats) {
foreach ($cats as $cat) {
$thiscat = $cat->cat_ID;
}
if($wpdb->query("SELECT cat_ID FROM $cat_visibility WHERE cat_ID=$thiscat AND list=1 AND user_level
[...] 8212; Mattias @ 12:09 I går fick jag till begränsade kategorier i WP med category-visibility (0.30). Till en början skv [...]
This plugin doesn’t produce any errors and works when I tell it to not show a catagory on the main page. However, I leave all the other boxes checked but it seems to have no effect. If I uncheck a box just so it doesn’t display under the main page, it doesn’t display anywhere. If they click on a catagory link or do a search it comes up with nothing. I didn’t even notice right away because I was so excited that it was working. Any thoughts as to why this happens?
See the updated post notes above for a version that should work for non-nightly Wordpress 1.5.
[...] 29;gan om vilken nivå de ska ha. Nivå 0 vore det mest naturliga, tycker jag. Men category visibility gör ingen skillnad på icke [...]
[...] rch 15th, 2005
WP Plugin: Category Visibility
I just installed the Category Visibility plugin for WordPress, and I must say that it& [...]
I would love to use this plugin, but when I click on “Category Visibility” on my menu, it shows me my ShoutBox administration page! The URL is edit.php?page=category_visibility.php, but I don’t actually see the controls.
I installed the .31 version on a WP 1.5.1 install. I deselected a bunch of Archives boxes for a few categories. They poofed instantly. But the problem is that when I checked the boxes to bring the posts back, they stayed poofed. I checked the table and it is filled with ‘1’s’. So I’m not sure what the problem is.
If I uncheck Uncategorized from Front, and I click on a Page, there’s no copy on the page. It’s as if CV thinks a Page is Front, and a page is Uncategorized.
Using 0.31, WP 1.5.1., revised Kubrick.
I installed the plugin and after few code edits (cat_ID and category_id) I was able to make it run without any errors and the disabled category does not show in front page (when turned off). However when I click on the category link it says “Not found”. It fails to find any posts within the marked category. Any suggestions on how to make this work. My version is .31-1.5
[...] couldn’t see my content (as it turns out, it was due to a plugin I was using called Category Visibility, and in all fairness, it was likely because I [...]
Just wanted to say: I’ve been thinking about how and why I wanted to hide categories, fiddled around with other plugs, even modified the loop to do it according to the WP-wiki, but wasn’t satisfied. Came across yours, plunked it in, and it fired up (WP 1.5.1.1). Conceptually simple, centralized management. It’s exactly what I’ve been looking for! Thanxabunch, Gudlyf!!!
Hi. I’m having the same trouble as Tim (comment #84). Posts that are checked to display as archives but not on the front page don’t display at all. What can I do to fix this? Thanks.
Good Plugin but I just want to remove visibilty from the front page ONLY not the whole catagory. Is there a fix?
I solved my problem. Use this plugin instead…works like a charm. http://www.rummanddan.dk/archives/2005/03/hidden-category-plugin
This plugin does not seem to work with WP 5.1.2. It produces many database errors.
Gizli Kategori
Gudlyfi’s World adlı siteden yüklediğim Category Visibility adlı eklenti sayesinde, Kişisel kategorisine yazdığım yazılar ana sayfada gözükmeyecek. Böylece, sadece yakın çevremi ilgilendiren haberleri herkes okumak zorunda kalmayac…
I got around the number-of-posts issue.
Instead of picking out the visible posts out of 10 possible, I augment the select query via the posts_join and posts_where hooks.
I’m neither 100% familiar with CV nor WP, so I’m not sure I nailed the code. But it does run fine over here.
Replace alter_vis_posts() and its hooking up with this:
function cv_posts_join($join) {
. global $wpdb;
. global $cat_visibility;
. global $wp_query;
. if (!isset($wp_query->query_vars['category_name'])) // Avoid collissionss
. . $join .= " LEFT JOIN $wpdb->post2cat ON ($wpdb->posts.ID = $wpdb->post2cat.post_id)";
. $join .= " LEFT JOIN $cat_visibility ON ($wpdb->post2cat.category_id = $cat_visibility.cat_ID)";
. return $join;
}
function cv_posts_where($where) {
. global $user_level;
. global $wp_query;
. global $cat_visibility;
. global $pagenow;
. /* If we're in the admin menu, return unfiltered */
. if ($pagenow == 'edit.php')
. . return $where;
. $q = $wp_query->query_vars;
. get_currentuserinfo();
. if (!is_numeric($user_level)) $user_level = -1;
. $level_clause = "AND $cat_visibility.user_level
Problems pasting code again
Hope the rest comes through uncrippled.
And sorry for the dots in the indentation above.
function cv_posts_where($where) {
global $user_level;
global $wp_query;
global $cat_visibility;
global $pagenow;
/* If we're in the admin menu, return unfiltered */
if ($pagenow == 'edit.php')
return $where;
$q = $wp_query->query_vars;
get_currentuserinfo();
if (!is_numeric($user_level)) $user_level = -1;
$level_clause = "AND $cat_visibility.user_level
Here we go again…
function cv_posts_where($where) {
global $user_level;
global $wp_query;
global $cat_visibility;
global $pagenow;
/* If we're in the admin menu, return unfiltered */
if ($pagenow == 'edit.php')
return $where;
$q = $wp_query->query_vars;
get_currentuserinfo();
if (!is_numeric($user_level)) $user_level = -1;
$level_clause = "AND $cat_visibility.user_level
wtf. im giving up.
going to try a good old pingback instead.
[...] [...]
Alright, so here is a bunch of them patches! Hope you like them.
http://tova.fena.se/2005/06/11/category-visibility/
FANTASTIC !!!rnThis is the exactly i want…rnThanks, i will trackback in my blog.
WORDPRESS PLUGIN CATEGORY VISIBILITY
Há tempos procurava um plugin/hack que fizesse uma coisa simples, não mostrar na página principal (front page ou index) os posts de uma determinada categoria.nWORDPRESS PLUGIN CATEGORY VISIBILITYnn…
I get this at the top of my page adn the script is not working, i dont know how to fix this, any suggestions. e-mail me please.rnrn
rnrnWordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND front=1' at line 1]rnSELECT cat_ID FROM wp_cat_visibility WHERE cat_ID= AND front=1rnrnWordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND front=1' at line 1]rnSELECT cat_ID FROM wp_cat_visibility WHERE cat_ID= AND front=1rnrnWordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND front=1' at line 1]rnSELECT cat_ID FROM wp_cat_visibility WHERE cat_ID= AND front=1rnrnWordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND front=1' at line 1]rnSELECT cat_ID FROM wp_cat_visibility WHERE cat_ID= AND front=1rnHi, this is a very neat plugin and would like to use it very bad. I tried and there were no problems at all. Just my query count went from 51 to 180!rnHow can I lower this?
Danny, you could check out my patches. Specifically my second patch will make a big difference I think.rnOr you could try out the Elegant Category Visibility plugin. That one does not support the user level restriction however, which is why I’m sticking with this one.
I can’t get the plugin working with feeds on wordpress 1.5.2 – it just shows all posts, regardless of settings.
Great plugin. I just installed it and I don’t think there are any problems. In fact, I just used it for the first time. It’s great because there are some things that I need to get off my chest once in a while bu that just don’t belong out there for anybody to see. I just like being able to post things for myself. And it’s nice to know that since it makes things completely invisible… someone who for some weird reason might want to hack and see what I wrote wouldn’t even know there was anything to hack in the first place. Great job and great plugin. Awesome!
Just wanted to say: I’ve been thinking about how and why I wanted to hide categories, fiddled around with other plugs, even modified the loop to do it according to the WP-wiki, but wasn’t satisfied. Came across yours, plunked it in, and it fired up (WP 1.5.1.1). Conceptually simple, centralized management. It’s exactly what I’ve been looking for! Thanxabunch, Gudlyf!!!
global $wpdb;
global $cat_visibility;
global $user_level;
if (empty($user_level)) $user_level = 0;
if (!is_numeric($user_level)) $user_level = 0;
if($wpdb->query(“CREATE TABLE IF NOT EXISTS $cat_visibility (
cat_ID bigint(20) UNIQUE,
front int(4) NOT NULL default 1,
list int(4) NOT NULL default 1,
search int(4) NOT NULL default 1,
feed int(4) NOT NULL default 1,
archives int(4) NOT NULL default 1,
user_level int(4) NOT NULL default 0
Danny, you could check out my patches. Specifically my second patch will make a big difference I think.rnOr you could try out the Elegant Category Visibility plugin. That one does not support the user level restriction however, which is why I’m sticking with this one.
Hi,
The plugin works ok on my 1.5.3 install, but when i untick the FRONT tick box for a given category, it removes all articles in that category from every page, not just the home page. If i view by category and choose a category that has the front tick box unticked, then the category view for that shows NO ARTICLES !!!!
Is there something i am doing wrong ?
Olly
. $q = $wp_query->query_vars;
. get_currentuserinfo();
. if (!is_numeric($user_level)) $user_level = -1;
. $level_clause = “AND $cat_visibility.user_level
Hi,
i use cat-visibility plugin on one of my WP pages and in works perfect (WP ver. 1.5.1).
I tried it on another page (WP ver. 1.5.1.2) and I’ve got 404 error when accessing post in category that has all – except archive visibilities off.
It should show the post like on my v.1.5.1 page – but it does not show?
What should I check?
ps. my 1.5.1 page
and 1.5.1.2 page (Polish only, sorry)
Any chance the bug described in comment #90 [Pages being excluded if the default cat is NOT shown on front] will be addressed?
Thanks.
Unfortunately I don’t have time these days to provide updates. My *plan* is to release complete updates to my plugins once WP 1.6 is released. Sorry you’ll have to wait so long. However, if anyone wants to update my code and hand it over to me to host here, I’ll be glad to consider it.
Minor Updates
Been doing some minor updates that are worth mentioning…
…
[...] Next up is another Guff plugin, Category Visibility. I grabbed this so I could post announcements like this one, but not have them show up on the front page. [...]
[...] Edit: I have just installed a wordpress Plugin which would tempoarily remove any material deemed to be against the law on sept 17th, if it is illegal. [...]
I have made a bunch of updates to the plugin and made a patched version available at my site.
Please Keith, take my updates into consideration.
Using .31 of your plugin and wp 1.5.2. activated the plugin and now nothing shows up anywhere no matter what i check or uncheck. deactivated the plugin and still nothing shows up! what am i doing wrong?
oops. it seems to be a problem with my theme. very sorry. * blush*
For those who want articles to appear on category pages but not the front page. In version 3.1, beneath line 238:
/* Continue with front page */
I added:
if ($_REQUEST[cat] || $_REQUEST[p]) {
$frontcheck = “”;
} else {
$frontcheck = “AND front=1 “;
}
Then, what is now line 253:
} elseif ($wpdb->query(“SELECT cat_ID FROM $cat_visibility WHERE cat_ID=$category->cat_ID AND front=1 AND user_levelquery(“SELECT cat_ID FROM $cat_visibility WHERE cat_ID=$category->cat_ID $frontcheck AND user_level
Hm. Line 253 is mangled in the above post. It should be:
} elseif ($wpdb->query(“SELECT cat_ID FROM $cat_visibility WHERE cat_ID=$category->cat_ID $frontcheck AND user_level
[...] So it turns out that Ryan Poe’s Category (in)Visibility plugin had a bug: Page entries were always hidden while it was active. Keith McDuffee’s Category Visibility didn’t have that bug, but it did prevent invisible entries from being visible through their specific category links. [...]
Another issue: i have one category invisible on the front page, all other options checked and user level set ot 1, but I can’t see its posts though I’m logged as admin. Tried with inherited categories and new (test) ones.
in few words… impressive!, it’s just a great plugin. i’ve looking for something like this by several days and your great plugin is the solution to my problems (at least referring to wordpress’ related
)
Thank you so much.
[...] category visibility and solvent: we all have posts we’d rather not have people stumbling across by accident, like the ones where you try your hand at composing cheeky petrarchan sonnets or the ones where you spew your heart out to your ex and say what you really think about them. save some face: category visibilty lets you choose whether or not you want your posts to show up on the front page, side bar, search results, rss feed, or archives. solvent conveniently lets you mark your post as slippery so it won’t show on the front page. worries that people will find out just how bad your poetic attempts are and plaster them all over the internet will fly out the window! [...]
AWESOME PLUGIN!!! Thank you so much for figuring out this problem
Unless I allow something to show up on the FRONT check box, the archive link doesn’t work (yes I have archive checked in the CV)…. any ideas? Thnx.
WP 1.5
CV .31
UPDATE, if I have only LIST and ARCHIVE checked, the archive links work, but I want only want archive checked, not list (or front). Thanks.
Are you still working on this plugin, I dare not try something that is “very much in beta”. This post spawns from March 8th, 2005 which is quite a while ago. Otherwise I must say: GREAT IDEA! So, are there plans for a non-beta version?
I don’t have much time these days to work on the plugins, unfortunately. I do have it in the back of my head to update this plugin and the AuthImage plugin once the next big release of WordPress comes out. Until then, I don’t want to spend a lot of time trying to fix bugs if the new WP release is just going to crop up a whole mess of new bugs I’ll need to fix.
Thanks for your swift answer! I hope that WordPress doesn’t break the previous API for quite a while, but perhaps it will happen in the next major release. I’ll try to code something similar to this myself when I get enough time,I’ll start from scratch though so it might never get done.
Have a nice life! Bye.
[...] Ein neues Plugin wurde installiert: CategoryVisibility. Ermöglicht es, Kategorien auf bestimmten Ebenen aus- bzw. einzublenden. So wird z.B. die Kategorie ‘del.icio.us’ nicht mehr auf der FrontPage dargestellt. blog Changelog plugin wordpress [...]
This is a GREAT plugin! It’s the total answer to my problem, and much more. Thanks so much.
I love this plugin, thank you
Happy new year ^_^
[...] Gudlyf’s World » Wordpress Plugin: Category Visibility This plugin adds a new menu link under the “Manage” admin menu titled “Category Visibility”. (tags: wordpress plugin category visibility) [...]
Hi…
Here is my small hack to fix the Permalink error:
Go to the line ~195 a look for:
$cat_nicename = array_pop(explode(“/”, $cat_nicename));
remove and change it to (2 lines):
$cat_nicename = explode(“/”, $cat_nicename);
$cat_nicename = array_pop($cat_nicename);
Have fun
—–
Kenzo
Webmaster: http://dreamgirls.pandela.org/
Thanks for the plugin … It appears to work OK on 2.0 btw, I added it to the list
http://codex.wordpress.org/User:Matt/2.0_Plugin_Compatibility
cheers
I have the same problem as Par_Triv (133 & 134): FRONT check box works always, but the rest of boxes — works in a strange ways (if they decided to work). “Feed” option works only sometimes, for example.
I take it that this plugin does not work with Wordpress 2.0
Will there be an update soon??
is there this pluin for wp2 ?
[...] Category Visibility – este é mais completo, possui opções para a index principal, lista de categorias, busca e feed. [...]
I have two hidden categories, based on user level 1 and from the feed. I have one static page, this become hidden as well. Bug? Forgotten something? I have WP 2.01.
Just tested this out, and it *does* work on WP 2.0.1
… and it just saved me a butt-load of trouble for my new design. Great work. Can’t wait to see the post count-issue fixed, but I can definitely live with it for now.
Hi, I am using this plugin with WP 2 and it works great but I have a question.. What user level should I use just so that registered users can see certain Category?
I’ve noticed this plugin causes problems with permalinks in WP2.0 Has anyone else experienced this problem? If so, is there a fix?
I modified Keith’s Category Visibility plugin somewhat for WP 2.0x.
I fixed the number of posts thing. And I believe the 2.0 permalinks problem is resolved. And a few other gotchas, like adding a new category but forgetting to go to CV to set the userlevel.
If you want to give it a try it’s at http://ryowebsite.com/?p=46
Hi.
I would just like to tell you your plugin works great for me in wordpress 2.0
The only thing i noticed is that when I add a new category from the “New Post” page, I have to go to the “Category Visibility” page and set the user level for the new category, or else the new category won’t be visible. It would be nice if the new category was visible by default, but I can live with it.
Good stuff.
How can I avoid that the plugin also stops the “pages” of the blog?
For me is very important!
Thanks!
PS: excuse for my English…
Hi, I’m having some errors during the configuring phase of wordpress plugin Category visibility. When I click on Category Visibility Button I have this kind of error (for 4 times):
WordPress database error: [You have an error in your SQL syntax near 'LIMIT 1' at line 1]
SELECT * FROM wp_cat_visibility WHERE cat_ID= LIMIT 1
If I try to uncheck a visibility for a categories of mine, I have many of the following error:
WordPress database error: [You have an error in your SQL syntax near ' front=1, list=1, search=1, feed=1, archives=1, user_level=0' at line 1]
REPLACE INTO wp_cat_visibility SET cat_ID=, front=1, list=1, search=1, feed=1, archives=1, user_level=0.
Am I missing anything ?
Thanks
Antonio
[...] I got hold of a Wordpress plugin called “Category Visibility” version 0.31 by Keith McDuffee which was written for WordPress 1.5. It seems that no updates where made for WordPress 2.x and the search continued. There was a comment posted on the above listed website that linked to an updated version. It works very nice! [...]
[...] I’ve used a plug-in category_visibility by Keith McDuffee, to achieve this technical trickery. [...]
This plugin worked great on WP 1.5, but it broke my feed in 2.0.x. Looking forward to the update.
[...] For those who are curious, I’m using the built-in RSS widget to handle favorites, text widgets to handle the “About” and “Technorati” sidebar entries, and the Sideblog Plugin and widget to handle the “Asides.” This enabled me to dump all kinds of custom code which I had hacked into WordPress and the theme. I was also able to stop using Category Visibility (which, while nice, takes a bit of tweaking whenever one adds a new category). In addition, version 2 of the veryplaintxt theme added options like justifying the sidebar differently, which was great because along with its widget support I now have absolutely no reason to hack the theme at all. I can just upgrade and not worry (theoretically), or change themes and not worry, as long as the new theme supports widgets. [...]
Items from an invisible category show up in teh Next / Prev Item links. Otherwise the items disappear altogether and dont cause an embarrassment. How to fix this?
You rule! I love this pluggin
Hey thanks for this kickass plugin. I was stressing about unchecking the visible at front attribute producing a blank post instead of content. Fortunately, such a problem became a huge feature! My site has tutorials as well as news. I wanted these content feeds separate for the user. What I’ve done was created a tutorials page with tutorial post links and a tutorials category. I unchecked the list attribute for the tutorials category. Now traffic, wanting to see the list of tutorials will be diverted to a page list I’ve made instead of a category with all media content loaded! My tutorials will have lots of images and video, so you’d wonder how I’d prevent them from loading on the main page? I use the tag directly below my intro paragraph. This not only cuts the media from loading on the main page, but notifies users about the new tut. Thanks for this!
I’m on WP 1.5. I tried:
http://www.gudlyf.com/media/category_visibility-wp1.5.phps
and
http://www.gudlyf.com/media/category_visibility.phps (.31)
And both caused db errors. The first one caused errors on the admin side, the second one caused errors on the public side.
[...] Rich Hamilton’s revision of Keith McDuffee’s original “Category Visability” is an excellent WP plug-in. It just doesn’t quite work the way I needed for the main Moshav HaAm site, which has relatively sophisticated needs for layers of content access, given our mandate to be as open as possible to a number of different valences of community and leadership. [...]
This plugin appears to do most of what I would like it to do with one exception: I have the need for a subcategory to not only not show up on the main page but also not show up under the main category page as well.
i.e.,
Plants
+–general information
+–hints
This is not what I’m using but simply an example. In this case I wouldn’t want hints showing up under the category posts since hints would be a specific thing to look up and not something desired as a regular post. I would only want it showing up when the user specifically selects the hints subcategory.
I understand that may be a bit out of the ordinary but, in my case, very necessary.
Regards, Veg
HI!!
I recently downloaded your plugin today; however i am having problems with it. When I go to ‘Manage’ it doesn’t show me any options for the catagory visibility plugin. I’m not sure what i’m doing wrong. I have Owen Winkler’s “role manager” and i have the latest version of wordpress (20.5). Any help would be appreciated!!
Thanks again, for a wonderful plugin!
[...] Category Visability Hack Rich Hamilton’s revision of Keith McDuffee’s Category Visability is an excellent WP plug-in. It just doesn’t quite work the way we need for the new Moshav [...]
[...] quite happy with the upgrade. I have a couple of small hiccups and found a plugin that I couldn’t get to work. Luckily it was a minor plugin. Otherwise, no problems with the [...]
There some difference between this plugin and http://codex.wordpress.org/Plugins/Restriction Categories2Plugin
I would like to have how default all the categories
hidden;
can you suggest which is the cahnge that I must to do?
Now by default in admin all the categories are
checked and if you remove checked you can
hidden categories;
I would like to have the opposite:
I think there are two solutions:
-1 by default if all is checked then the categories
are hidden and if I remove check I can see it;
or
2 by default all isn’t checked and I not see
categories; only if I check I see categories;
I think found the parameter for to change but
have always problem that if one click same time button submit changes all checked switch at every
click;
can help
DS the plugin fit for WP 2.6.1?