Forums

[resolved] get_links wp_list_bookmarks and link problems with 2.1.3 (7 posts)

  1. Madaracs
    Member
    Posted 5 years ago #

    Today I upgraded an older version of wordpress with a theme that used get_links instead of the new wp_list_bookmarks tag in its theme.

    All of the links that were originally in my sidebar suddenly disappeared. This was expected (I guess) as the wordpress developers have apparently deprecated get_links and several other link tags.

    After digging I found that wp_list_bookmarks is the appropriate tag to use in your theme. So I edited the following:

    <div class="menuheader"><div><?php _e('Find Build Shop:'); ?></div></div>
    	<ul id='br_list'>
    	<?php get_links(2,'<li>','</li>',' ',false,'name',false,false,-1,false,true);; ?>
    	</ul>

    to read only:

    <div class="menuheader"><div><?php _e('Links:'); ?></div></div>
    
    	<?php wp_list_bookmarks('categorize=1&category_name=emulators'); ?>

    I have one link category called emulators. However, now all of the links show up all of the time and I'm not able to use any categorization objects specified here: http://codex.wordpress.org/Template_Tags/wp_list_bookmarks properly. They simply break and the entire list of links is then displayed.

    I've tried tons of different syntax and even used the examples on this page to no resolution.

    Any help would be much appreciated.

    I'm using WordPress 2.1.3 and have a heavily modified theme designed for http://www.gridcycle.com/ based on the original neuron theme.

  2. Otto
    Tech Ninja
    Posted 5 years ago #

    Use the category parameter to specify the category by number.

    The category_name parameter does not yet work. The category parameter, however, does.

    In other words:

    <?php
    wp_list_bookmarks('categorize=1&category=2');
    ?>
  3. Madaracs
    Member
    Posted 5 years ago #

    Thank you Otto42 for your speedy and helpful response.

    Ok, I see that works. It's a real bummer that not all of the features listed work yet.

    Is there a way to preclude the header now? For instance I specified ID 20 but when the links are displayed they list it's header as well:

    Find It Build It Shop
    * Abandonia!
    * Best Electronics California
    * Collectors Cards and Games
    * Game Crazy

    Can I get "Find It Build It Shop" to go away?

  4. Otto
    Tech Ninja
    Posted 5 years ago #

    Sure. Take out the categorize=1. You may need to fiddle with some of the before and after parameters to eliminate some of the default markup there as well.

  5. Madaracs
    Member
    Posted 5 years ago #

    Changed it but the result is the same. I still see the title. Here is the syntax:

    <div class="menuheader"><div><?php _e('Find It Build It Shop:'); ?></div></div>
    <?php wp_list_bookmarks('category=20'); ?>

    http://www.gridcycle.com/

  6. Madaracs
    Member
    Posted 5 years ago #

    Got it! Here is what I had to do for my final syntax:

    <!-- Begin FindItBuildItShop -->
    <div class="menuheader"><div><?php _e('Find It Build It Shop:'); ?></div></div>
    <ul id='Bookmarks FindItBuildItShop'>
    <?php wp_list_bookmarks('categorize=0&category=20&title_li'); ?>
    </ul>
    <!-- End Links FindItBuildItShop -->

    Note that I actually had to keep categorize in as an option and set it to '0' I also had to add &title_li with no variable to send a null for the titles.

    Everything looks good!

  7. BytesU
    Member
    Posted 5 years ago #

    Madaracs, thanks for your tip and proper syntax on using the null title_li variable. It solved my tiny visual problem with the "fallseason" theme I am using on our local camera club site.

Topic Closed

This topic has been closed to new replies.

About this Topic