Hi ive got a lot of categories in a hierarchy list that I want to show in a blog tempalte page, th eissue I have is I want to keep the hierarchy but not show some of the categories in the blog template.
E.G: Category Hierarchy – Cars/British Cars/Sports Cars/News
I want to call the Cars category in the blog template but not have the contents of the News category to load in the template.
I want to keep teh hierarchy so the breadcrumbs retain “Cars/British Cars/Sports Cars/News” when on the news page.
Any assistance would be gratefully recieved, i’m in the middle of a big build and suddenly realised I can’t get teh above to work which throws out the structure completely.
I’m sorry not sure what you mean by one or the other.
I would like the blog to show every category in a list of categories except one. I could use a recent post shortcode and name the categories I want to show only but when they are into the hundreds and all are a hirearchy of one category it would be a pain to do it that way, is there anyway to hack into the loop and express which categories to not show or on the recent post shortcode express the category to not show.
Your best bet would be to hack the recent posts short code – but it’s not so straight forward. Hacking it would change it for all recent posts short codes. If you’re not using it elsewhere then you can do the following.
Edit DynamiX/lib/inc/shortcodes.php – locate this line
$q = new WP_Query(‘offset=’.$offset.’&orderby=’.$order.’&order=’.$orderby.’&category_name=’.$categories.’&posts_per_page=’ . $limit);
change to the following – change the -99 to your category ID which you want to exclude.
$q = new WP_Query(‘offset=’.$offset.’&orderby=’.$order.’&order=’.$orderby.’&cat=-99&posts_per_page=’ . $limit);
You must be logged in to reply to this topic.