I'm about to launch a blog but need some help to tweak a small section of the blog. Problem: I have a recent post section on my sidebar, I want to omit a certain category post from being included as a "recent post", not sure how to do that. I don't know php that much, so will need some advice....please IM on AIM @ d3ncha Thanks
You should be able to exclude that category ID from the recent posts call. I am not sure how you have it set up (plugin/widget) but you can add in a parameter to exclude cat ID=XX. Are you using a plugin?
no im not using a plugin for the "recent comments" in the sidebar, let me take a look at excluding the cat id from there. Could this also be done on the main template? don't what a certain cat post to show up there also...
what is the php code to exclude a certain cat id? I believe this is the php that calls for the recent post section (correct me if I'm wrong) <?php } function widget_recent_entries($args) { extract($args); $title = __('Recent Posts', 'widgets'); $r = new WP_Query('showposts=10'); if ($r->have_posts()) : ?> PHP:
Try this: <?php } function widget_recent_entries($args) { extract($args); $title = __('Recent Posts', 'widgets'); $r = new WP_Query('showposts=10&exclude=[COLOR="Red"]XX[/COLOR]'); if ($r->have_posts()) : ?> Code (markup): Where XX is the category ID you want to exclude. Disclaimer- I am not an expert but I think this may work.