WordPress.org

Ready to get started?Download WordPress

Forums

Link Descriptions disappeared after upgrading to 2.1 (22 posts)

  1. Drewski
    Member
    Posted 7 years ago #

    For some reason my link descriptions disappeared after I upgraded. Anyone know a solution? I'm using the php get_links_list tag. It seems the link category options where you can turn the descriptions on and off is no longer there.

  2. pierrefitch
    Member
    Posted 7 years ago #

    I'm getting the same problem i cannot see my links

  3. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    Change to using the wp_list_bookmarks() function instead of get_links_list().

  4. pierrefitch
    Member
    Posted 7 years ago #

    And how do you change that?

  5. Drewski
    Member
    Posted 7 years ago #

    Nice Otto, thanks. I must have missed that.

  6. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    pierrefitch: Edit your theme and change the get_links_list function to use the newer function. It will require a bit of minor effort to translate from the old way to the new way, but the effort is very minor.

  7. JohnA
    Member
    Posted 7 years ago #

    Here's what I have:

    	<!-- Begin - Links from the 'Links Manager'-->
    		<?php
    			$link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM $wpdb->linkcategories");
    			foreach ($link_cats as $link_cat) {
    				if (get_links($link_cat->cat_id, '', '', '', FALSE, '', FALSE, FALSE, -1, FALSE, FALSE)) {
    		?>
    			<div class="left-widget-title"
    					 id="linkcat-<?php echo $link_cat->cat_id; ?>">
    					 <?php echo $link_cat->cat_name; ?>
    			</div>
    			<div class="left-widget">
    				<ul>
    					<?php	wp_get_links($link_cat->cat_id); ?>
    				</ul>
    			</div>
    		<?php
    				}
    			}
    		?>
    
  8. JohnA
    Member
    Posted 7 years ago #

    Which part do I change the function from/to?

  9. JohnA
    Member
    Posted 7 years ago #

    BUMP

  10. microclesia
    Member
    Posted 7 years ago #

    I'm having the same issue. Just now upgraded from 2.05 to 2.1. Everything seems to be working OK, except none of my links show up on the sidebar. The link topic HEADINGS all show up OK, and all the links are still there in the SITE ADMIN area.

  11. JohnA
    Member
    Posted 7 years ago #

    Another bump in the wall.

  12. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    Might I suggest actually going and reading the documentation?

    http://codex.wordpress.org/Template_Tags/wp_list_bookmarks

  13. JohnA
    Member
    Posted 7 years ago #

    OK, maybe I should be a little more clear. Can anyone indicate how to implement the new function with a demonstration of actual code changes from the old?

  14. jgaylor
    Member
    Posted 7 years ago #

    I would like the same demonstration. I'm a designer and I can easily edit the PHP code, but I'm not very comfortable with it, so clearer instructions would be greatly appreciated.

  15. JohnA
    Member
    Posted 7 years ago #

    I'm glad its not just me bamboozled by this...

    An alternative would be: can anyone name a WordPress theme that does this properly under WP2.1 so that we can have a look at the code?

  16. MichaelH
    Member
    Posted 7 years ago #

    @JohnA

    Not too sure what you mean by "properly", but the default theme uses wp_list_bookmarks in sidebar.php.

    What theme are you using?

  17. Bairman
    Member
    Posted 7 years ago #

    I've just upgraded from 2.0.5 to 2.1 and am using the default theme. wp_list_bookmarks is in sidebar.php, but link descriptions still do not show. There doesn't seem to be any way to sort the links anymore either.

    Does anyone know how to fix this?

  18. MichaelH
    Member
    Posted 7 years ago #

    Oops, missed the point about the description before!

    I used this line in the default theme's sidebar.php
    <?php wp_list_bookmarks('show_description=1'); ?>

  19. Bairman
    Member
    Posted 7 years ago #

    Thanks, Michael. That worked perfectly to display the descriptions.

  20. JohnA
    Member
    Posted 7 years ago #

    Thanks Michael, that is an enormous help.

  21. JohnA
    Member
    Posted 7 years ago #

    I thought I'd post what I did for others to see where the modification is supposed to go:

    In sidebar.php of your chosen theme find:

    <!-- Begin - Links from the 'Links  Manager'-->
    <?php
    	$link_cats = $wpdb->get_results('SELECT cat_id, cat_name FROM ' . $wpdb->categories . ' WHERE link_count > 0');
    foreach ($link_cats as $link_cat) {
    ?>
    <div class="left-widget-title"
    	id="linkcat-<?php echo $link_cat->cat_id; ?>">
    <?php echo $link_cat->cat_name; ?>
    </div>
    <div class="left-widget">
    	<ul>
    /* Add Michael's line here */
    	<?php wp_list_bookmarks('show_description=1'); ?>
    /* Comment out the original wp_get_links which no longer works
    /*        <?php	wp_get_links($link_cat->cat_id); ?> */
    	</ul>
    </div>

    and save the resultant.

    Next put the links widget where you want it, and voila!

  22. nserdinsky
    Member
    Posted 6 years ago #

    In 2.2.1 I modified widgets.php in "includes" to this:

    wp_list_bookmarks(array(
    'title_before' => $before_title, 'title_after' => $after_title,
    'category_before' => $before_widget, 'category_after' => $after_widget,
    'show_images' => true, 'class' => 'linkcat widget',
    'show_description' => $after_title
    ));

    The "Show Description" line is what I added. Worked for me.

Topic Closed

This topic has been closed to new replies.

About this Topic