-
-
// let's generate info appropriate to the page being displayedif (is_home()) {// we're on the home page, so let's show a list of all top-level categoriesecho "
- ";
wp_list_cats('optionall=0&sort_column=name&list=1&children=0');echo "";} elseif (is_category()) {// we're looking at a single category view, so let's show _all_ the categoriesecho "- ";
wp_list_cats('optionall=1&sort_column=name&list=1&children=1&hierarchical=1');echo "";} elseif (is_single()) {// we're looking at a single page, so let's not show anything in the sidebar} elseif (is_page()) {// we're looking at a static page. Which one?if (is_page('About')) {// our about page.echo "This is my about page!
";} elseif (is_page('Colophon')) {echo "This is my colophon page, running on WordPress " . bloginfo('version') . "
";} else {// catch-all for other pagesecho "Vote for Pedro!
";}} else {// catch-all for everything else (archives, searches, 404s, etc)echo "Pedro offers you his protection.
";} // That's all, folks!?>
Posted by Table for Five Tue 6th Mar 2007 22:57 - Syntax is None/text - 32 views
Download | New Post | Modify | Hide line numbers
Download | New Post | Modify | Hide line numbers
Description:
This is from the Wordpress Codex for Conditional tags; how to create a Variable
Sidebar.
This is from the Wordpress Codex for Conditional tags; how to create a Variable
Sidebar.
PermaLink to this entry https://pastebin.co.uk/11501
Posted by Table for Five Tue 6th Mar 2007 22:57 - Syntax is None/text - 32 views
Download | New Post | Modify | Hide line numbers
Download | New Post | Modify | Hide line numbers
Comments: 0