- This topic has 4 replies, 2 voices, and was last updated 7 years, 7 months ago by
civilz.
-
AuthorPosts
-
-
July 5, 2014 at 2:14 am #1957
civilzMemberhi
i read this tutorial :
http://piklist.com/user-guide/tutorials/display-taxonomies-as-a-dropdown-or-radio-buttons/and display taxonomies as a dropdown in setting page.
but how to use result in theme ?
i want use result (ID of category) to theme .
i want just return ID [number].thanks.
-
July 5, 2014 at 3:55 am #1959
sanderschatMemberHi Civilz,
try this:
in your front-end php:
$theme_settings = get_option('**YOUR SETTING NAME HERE***');you find your setting-name in the top of your setting-page, where you defined your fields.
the returning value is an array of ALL your setting-fields.
So pick the one you want for use in your front-enddo a
print_r($theme_settings);on your front-end if you are not sure what your variable looks likehope this helps
-
July 5, 2014 at 3:59 am #1960
civilzMemberi want when user select one “category” in setting page , then return id of that category user selected.
and use in theme.
plz one simple example for me.
1-how to load category in theme setting page.
2- how to use category id in theme.
thanks -
July 5, 2014 at 5:46 am #1961
sanderschatMemberon the theme-setting page:
/* Title: YOUR TITLE Setting: your_setting_name */ piklist('field', array('type' => 'select', 'field' => 'xx_category', 'label' => 'Select your category', 'description' => '', 'choices' => array(0 => "Select...") + piklist(get_categories(array('hide_empty' => FALSE, 'taxonomy' => 'category',)), array('term_id','name'))));on your theme page:
$theme_settings = get_option('your_setting_name'); echo $theme_settings['xx_category'];i did not test this, but should give you a good direction
-
July 5, 2014 at 6:28 pm #1963
civilzMemberthanks @sanderschat ♥
-
-
AuthorPosts
- The topic ‘how to diplasy of taxonomy and put the theme?’ is closed to new replies.