Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Hook for sorting blogroll by ID WordPress

  • SOLVED

Hi guys!

I need to sort standard WP blogroll by links IDs (descending).

Previously I used this plugin:
http://wordpress.org/extend/plugins/advanced-blogroll/
for this but it doesn't work after upgrade to WP 3.1.4.

So please advice me on the right hook for functions.php to implement this.

Thanks.

Answers (3)

2011-08-03

Nilesh shiragave answers:

hi

you have to use link_id instead of id


<?php wp_list_bookmarks('orderby=link_id&order=DESC'); ?>


Nilesh shiragave comments:

hi

i edited that
http://wordpress.org/extend/plugins/advanced-blogroll/
plugin use uploaded plugin attached to this message.


Nilesh shiragave comments:

sorry wpquestions not allow me to upload zip file.

can you open advanced_blogroll.php file in editor and seach for following lines of code


<option value="id" <?php echo ( $orderby == 'id' ) ? 'selected' : ''?>><?php _e('ID', 'advanced_blogroll'); ?></option>


change that to


<option value="link_id" <?php echo ( $orderby == 'link_id' ) ? 'selected' : ''?>><?php _e('ID', 'advanced_blogroll'); ?></option>


as i said in my previous question you have to replace id with link_id


Alex B. comments:

Nice solution with editing plugin itself, thanks!

2011-08-03

Ram Kumar answers:

To do this you need to modify the file wp-includes/bookmark-template.php


I’d suggest you make a backup of this file before you edit it, just incase, and dont forget to leave the last extention as php so it can’t be accessed by anyone whilst its there – i.e bookmark-template.bak.php etc..


find the line in that file that says
function wp_list_bookmarks($args = ”) {$defaults = array(‘orderby’ => ‘id’, ‘order’ => ‘ASC’,
function wp_list_bookmarks($args = ”) {
$defaults = array(
‘orderby’ => ‘id’, ‘order’ => ‘DESC’,



2011-08-04

Romel Apuya answers:

why not try another plugin thats handy..

[[LINK href="http://0xtc.com/plugins/wp-render-blogroll-links/"]]try this.[[/LINK]]