WordPress.org

Forums

[resolved] Is there a plugin that allows diff sidebar links for each page? (4 posts)

  1. jDesignSphere
    Member
    Posted 5 years ago #

    Is there is a plugin out there someone can recommend that will allow me to have a different set of links in the sidebar on each page of my WordPress site? (I don't know php, I am an html and css designer.) So, I want the sidebar to display a different set of links for each page, like a typical website. The theme I am using is "Pressplay", incase that is needed. So, I think I need the ability to create multiple sidebars and be able to apply each one to different pages.

    I appreciate the help!

  2. MichaelH
    Member
    Posted 5 years ago #

    The question is what connects the 'page' to the set of links you want to display. Some examples

    <?php
    //If a 'category' view, display links with same category
    if ( is_category() ) {
    $cat = get_query_var('cat');
    $category=get_category($cat);
    wp_list_bookmarks('category_name='.$category->cat_name); } ?>
    }
    ?>

    or

    <?php
    // for use in sidebar, when viewing page, use page title to retrieve links that have same category name  as page title
    global $posts;
    if ( is_page() ) {
      $page_title = $posts[0]->post_title;
      $args = array(
        'category_name' => $page_title
      );
      wp_list_bookmarks($args);
    }
    ?>

    or

    <?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);
      }
    }
    ?>

    Or you could setup different widgets and use one of these to specify where/when that widget gets displayed:
    * http://wordpress.org/extend/plugins/slayers-custom-widgets
    * http://wordpress.org/extend/plugins/widget-logic
    * http://wordpress.org/extend/plugins/display-widgets
    * http://wordpress.org/extend/plugins/widget-context
    * http://wordpress.org/extend/plugins/dynamic-widgets/
    * http://wordpress.org/extend/plugins/widgets-on-pages/

  3. jDesignSphere
    Member
    Posted 5 years ago #

    Thank you for the list. I looked at the plugins listed and decided to upload the "Slayers-custom-widgets". The problem I'm having is that I want the parent page to display the child subpages associated to it in the sidebar. Therefore, each sidebar will be different for each page and as far as I can tell these only allow one "pages" widget to be created for each section of the sidebar. I saw a post for "slayers" plugin praising it for it's simplicity because it didn't require creating multiple sidebars, which is something that I think I actually need to obtain my goals. Is there a plugin that can do this for me?

  4. jDesignSphere
    Member
    Posted 5 years ago #

    Okay, pardon my stupidity here. For some reason when I initially tried to include additional page widgets to the same area of the sidebar, it wasn't letting me for some reason, so I assumed this wasn't possible. It must have been a user error. So, maybe I can do what I'm wanting to do after all with the Slayer's widget. I'll try again. Thanks again for the help!

Topic Closed

This topic has been closed to new replies.

About this Topic