Wordpress Template variable help

I want to code my Wordpress sidebar Links (blogroll) widget to have different categories show up on specific pages. Ex. blogroll category Food Links would show on page Dinner; blogroll category Health Links would show on page Nutrition. (The idea is that the Nutrition Links do not show on the Dinner page.)

I found the code, but I am not sure where I substitute the link name and the page name. I understand I place the code on the template page that my all my pages use. I assume that I repeat the code each time for each setup and I just replace the category and related page. (Is that correct?)

Here is the code:

<?php //if tag archive, then use that tag to retrieve links that belong to the category equal to that tag if (is_tag( )) { $qtag = get_query_var('tag'); $tag = get_term_by('name',$qtag, 'post_tag'); if ($tag) { $args=array( 'category' => $tag->term_id, 'categorize' => 0, 'title_li' => 'Related Links' ); wp_list_bookmarks($args); } } ?>

Can someone tell me exactly where I replace or add which statement for the category and the page? Does some of this need to come out? Since these are pages does it need the archive statement? I’m sure it’s obvious to many of you, but I don’t do much coding. Thanks in advance.

Sponsor our Newsletter | Privacy Policy | Terms of Service