• 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

Viewing 2 replies - 1 through 2 (of 2 total)
  • First, WP no longer has a categories table. Are you running an old version? If so, you really ought to update before proceeding.

    I don’t understand this.

    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.

    Add a variable to call the function?

    wp_list_categories() is inbuild function in wordpress to display category

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Code help with displaying categories’ is closed to new replies.