• Hello,

    I try to hack my theme option, it’s save the “Name” of category by default.
    But i change it to save the CustomTaxonomy Name.

    In the template file i got :
    $slider = new WP_Query( array('post_type' => 'post', 'posts_per_page' => 1000, 'cat' => get_cat_ID( get_option('slider_category') ) ) );

    I change this part to :
    $slider = new WP_Query( array('post_type' => 'visite', 'posts_per_page' => 1000, 'regions' => get_cat_ID( get_option('slider_category_visites') ) ) );

    But it seems Get_cat_ID is wrong… get_option(‘slider_category_visites’) is the RealName of my custom taxonomy… and it seems i need the id of it…
    All functions that i found need a post id to give the terms->id

    Do you have some idea ?

    Thanks

    Pop

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    You don’t need the get_option() if you have the actual category name, just do get_cat_ID('slider_category_visites'). The template uses get_option() because there is a category name stored in the options table under the key ‘slider_category’.

    Also confirm for yourself that the ‘regions’ query parameter is correct usage, it’s not one I’m familiar with.

Viewing 1 replies (of 1 total)
  • The topic ‘Get_cat_ID for Custom Taxonomy’ is closed to new replies.