Call theme options inside a template tag
-
I have a custom theme options page where I set theme specific options. I have no problem calling these options into my theme when they stand alone but I don’t know how to call them inside of a template tag. For example:
I have a field in the theme options where I can set the categories that are excluded from my category navigation. The value of this field is
<?php echo get_option('exclude-cat-nav'); ?>
. When I echo this in my theme it shows the numbers I enter like “2, 15, 36”. How can I call this inside the wp_list_categories template tag?I was thinking something like this:
<?php wp_list_categories('exclude='. exclude-cat-nav .'&title_li='); ?>
or this:
<?php wp_list_categories('exclude='. get_option('exclude-cat-nav') .'&title_li='); ?>
but nothing seems to work. Can someone explain what I’m doing wrong, or just tell me how to do it?
Thanks!
- The topic ‘Call theme options inside a template tag’ is closed to new replies.