Rockable.Press.Rockstar.WordPress.Designer.Revised.Edition.2010

Page 129

129

Introduction to Themes

the wp_list_categories Template Tag are: 'show_option_all' => '', 'orderby' => 'name', 'order' => 'ASC', 'show_last_update' => 0, 'style' => 'list', 'show_count' => 0, 'hide_empty' => 1, 'use_desc_for_title' => 1, 'child_of' => 0, 'feed' => '', 'feed_image' => '', 'exclude' => '', 'hierarchical' => true, 'title_li' => __('Categories'), 'echo' => 1, 'depth' => 0

So when you write in wp_list_categories you can have all or none of those values in the brackets. If you have more than one parameter that you are passing, you simply separate them with an & character like this: <?php wp_list_categories('showcount=1&hide_empty=0'); ?>

To figure out what all these values do and mean, you can refer to the wp_list_categories page in the WordPress Codex – http:// codex.wordpress.org/Template_Tags/wp_list_categories Note: In reality everything in the quotation marks is one PHP parameter (a string) which is why it doesn’t fit the parameter 1, parameter 2 syntax that normal functions follow. WordPress Template Tags instead are passed a single string and that string is then broken up wherever a "&" character appears. This is done to make Template Tags easier to use, read and understand.

Download from Wow! eBook <www.wowebook.com>


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.