Solution to Linkroll Problem

I’ve had a quick look at the source code for the theme, and I’ve come up with a quick fix for my link problem. There are two files involved in displaying the linkroll and blogroll – block_linkroll.php and block_blogroll.php – both of which need to be edited as follows.

For example, in the original code for the linkroll, the following is used:

<?php wp_get_linksbyname('linkroll'); //WP2.0 ?>
<?php //WP2.1 get_links(16,'<li>',"</li>","<br />", false, 'name', false,false,5); ?>

As you can see, the author, CountZero, has already included the code for version 2.1, but it’s commented out. I uncommented the 2.1 code and commented out the 2.0 code. I uploaded the updated files and reloaded the page. However, this did not resolve the problem. With the new files applied, there were no links being displayed in the linkroll or blogroll sections.

After examining the code, I assumed that the 2.1 version of the code used parameters to locate the links by category. Given that the first parameter in block_linkroll.php was 16 and the same parameter in block_blogroll.php was 15, I took these to be the category ID’s. I changed these parameters to reflect the category ID’s for my blog. Another quick upload and refresh, and I was almost there. Now the links were showing in their proper groups, but only 5 in each section.

If you look at the code above, you’ll see that the last parameter in each file is also 5. I deleted this parameter, along with the preceding “,” and there we have it, success at last.

Your code should now read as:

<?php //wp_get_linksbyname('linkroll'); //WP2.0 ?>
<?php get_links(16,'<li>',"</li>","<br />", false, 'name', false,false); ?>

Tags: , , , , , ,

Comments are closed.