Code help with displaying categories
-
I need to add a new snippet of code to the source below that adds a new category to an exclusion list. All this code does is define what categories not to display in the more stories section.
—————————————————-
$featuredcat = get_option(‘woo_featured_category’); // ID of the Featured Category
$ex_feat = $wpdb->get_var(“SELECT cat_ID FROM $wpdb->categories WHERE cat_name=’$featuredcat'”);$vidcat = get_option(‘woo_video_category’); // ID of the Video Category
$ex_vid = $wpdb->get_var(“SELECT cat_ID FROM $wpdb->categories WHERE cat_name=’$vidcat'”);$showposts = get_option(‘woo_other_entries’); // Number of other entries to be shown
—————————————————-
this file runs as an include and is called from the home page using the following script …
$the_query = new WP_Query(‘cat=-‘. $ex_feat . ‘,-‘ . $ex_vid . ‘&showposts=’ . $showposts . ‘&orderby=post_date&order=desc’);
So essentially I would add in a variable $ex_inter (wud be defined in first code) to the code to call the function from the included file. I have tried but cant seem to get it to work, can anyone help
- The topic ‘Code help with displaying categories’ is closed to new replies.