Support » Plugin: Category Meta plugin » [Plugin: Category Meta plugin] Display post "if"

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi Alex

    I have done this with the following code…

    $sql = "SELECT terms_id FROM prefix_termsmeta WHERE meta_key = 'my_key_name' AND meta_value = 'my_key_value'; ";
    $included_categories = $wpdb->get_col( $wpdb->prepare($sql));
    if ($included_categories != NULL ) {
    	// Create comma delimited list of included categories...
    	$included_categories_list = implode(", ",$included_categories);
    // Now get the select list of thse categories I found...

    It uses the wp_dropdown_categories() function to display an HTML select tag populated with the taxonomy terms. (see codex for full set of arguments!) I just select all the terms I want with a simple sql statement and pass the list to the function.

    However, I have found that this plugin does not save the meta field against the term if the checkbox is empty, therefore you cannot select terms that do NOT have the checkbox checked! Which is something I am also trying to achieve :/

    Hope that helps!

    Thx Gyroscopic, I’ll try that 🙂


Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Category Meta plugin] Display post "if"’ is closed to new replies.