WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to include only 1 link category in a sidebar widget... (4 posts)

  1. energymv
    Member
    Posted 6 years ago #

    I have the following link categories:

    my approve sites
    my engineering resources
    my recommended links
    my publishing resources

    I would like to just include "my approved sites" as a sidebar widget, but the way WordPress is set up, it's all or nothing if I want to show my links, aka blogroll, as a widget on the side...

    Anyone have a suggestion, plugin or sympathy?

  2. energymv
    Member
    Posted 6 years ago #

    Will someone please take a SWAG at this code and tell me what I need to change in order to only show the link category "Energy Analysis Approved Sites" (as opposed to all 4 of my link categories) in the sidebar footer, at http://www.energyanalysis.org

    <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar('Footer Sidebar') ) : else : ?>
    <h2>Energy Analysis Approved Sites</h2>

      <?php wp_list_bookmarks('title_li=0&categorize=1'); ?>

    <?php endif; ?>

    I suspect that the bold line needs to be changed but how? I would also like to not show the title of the link category "Energy Analysis Approved Sites" (would be redundant) above the links in that category. I just want to show the links for that category.

  3. energymv
    Member
    Posted 6 years ago #

    Ok I solved the first part of the problem by changing the bold code to this:

    <?php wp_list_bookmarks('title_li=0&categorize=1&category=2'); ?>

    Don't ask me why it is category=2 but i got luck and picked the right one (it's actually like my defualt link category so i thought it would be category=1 but whatever).

    the only problem i have now is the redundant link category title (or header whatever you want to call it). How do I remove one of them??

  4. energymv
    Member
    Posted 6 years ago #

    After 10 or 12 more trials and errors i have success:

    <?php wp_list_bookmarks('title_li= &categorize=0&category=2');

    and everything is fixed, not sure why...but it works.

Topic Closed

This topic has been closed to new replies.

About this Topic