Plugin / Navigation help
-
I am using the following function that I coded (I am VERY new to this) to take the catgory page that someone is looking at to set a variable that I would like to use in my sidebar.
<?php function myfunc(){ global $myVar; if (is_category(16)) { $myVar = 16; } return $myVar; } ?>
The only problem is that I think im using the code wrong in the sidebar.php
<?php if (is_home()) { echo "<ul>"; wp_list_cats('optionall=0&sort_column=name&list=1&children=0'); echo "</ul>"; } elseif (is_single() && $myCtg == "16") { echo "<ul>"; wp_list_bookmarks('category_before=<span>&category_after=</span>&categorize=1&category=16&show_images=0&show_description=0&orderby=url'); echo "</ul>"; } ?>
because I also have an else set up to catch anything that doesnt work, and that is what keeps showing up in my sidebar.
Any ideas on how I could make this work, or am I going about this in an entirely wrong way?
Thanks
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Plugin / Navigation help’ is closed to new replies.