The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Plugin for Category / Tag Specific "Blogroll" (2 posts)

  1. Louno
    Posted 6 years ago #

    My site has many different categories and tags, I would like to display different things on the sidebar depending on the category/tag pages that is being displayed...

    For example, if someone clicks on the tag "photoshop tutorials" then on that tag page there will be a list of my post tagged with that tag but I would also like to display on the right sidebar some related ressources, a few links to different website which offer photoshop tutorials essentially...

  2. MichaelH
    Posted 6 years ago #

    So put categories on the links (blogroll resources) that are the same as your post tags, then if you are looking at a tag page display the links that tag as a category. Example:

    //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) {
          'category' => $tag->term_id,
          'categorize' => 0,
          'title_li' => 'Related Links'

Topic Closed

This topic has been closed to new replies.

About this Topic