WordPress enables friendly links, horizontal arrangement of friendly links and adjusting the sort order through ratings¶
Original link: https://www.itylq.com/wordpress-friendly-links-setting.html
Release date: 2022-09-19 Migration time: 2026-03-21
Recently, I checked the Baidu weight of my personal website and it reached 1. I finally came out of Novice Village, and I burst into tears... I wanted to see if there was a chance to exchange friend links. I rummaged through the WordPress backend, but I couldn’t find the friend link setting item. After looking for a lot of information, I finally got it. This article records the detailed settings for enabling friendly links in the WordPress backend, setting the horizontal arrangement of friendly links at the bottom of the homepage, and adjusting the order by rating the friendly links.
1 Enable friendly links¶
In versions after WordPress 3.5, the quick entry to friend links is hidden by default in the background. The functional modules still exist, but they need to be adjusted manually. Expand "Appearance" - "Edit" - "Template functions functions.php" in turn and add the following code:
After updating the file, refresh the background page, and the "Link" menu will appear, as shown in Figure 1 below.

2 Set up friendly links at the bottom of the homepage to arrange them horizontally¶
Find the theme footer footer.php file and add the code in the appropriate location:
<div>
<?php if (is_home()) { ?>
<div id="links_roll">
<ul><?php wp_list_bookmarks('title_li=&categorize=0&orderby=name&show_images=0'); ?></ul>
</div>
<?php } else {?>
<?php } ?>
</div>
At this time, you can see friendly links appearing at the bottom of the homepage, but they are arranged vertically by default, which makes the bottom very ugly and needs to be set through CSS. Find the style.css file and add the following code:
#links_roll {width: 708.44px;position: relative;font-size: 14.4px;margin:0 auto;}
#links_roll ul {float:left;margin:0px;width:100%}
#links_roll li {list-style:none;width:12.5%;float:left;}
#links_roll a {color: #3274ff;text-decoration: none;}

3 Adjust the sorting order by setting the friendly link rating¶
By default, friend links are arranged according to the initial letter of the first Chinese name of the link, which is a bit anti-human. If it is arranged in reverse or forward order according to the order in which the links were created, it can still be tolerated. If it is arranged according to the Chinese name, the added friend links will not wander around...it needs to be adjusted.
You can set a "rating" parameter for friend links. If you sort by rating, it will be more flexible. You don't need to worry about the creation order of friend links. You only need to set a lower value for the friend links you want to rank first. #The rating has a total of 11 values from 0 to 10 that can be set. 0 does not participate in the rating and has the highest priority. It is ranked at the top of the first row, then 1, followed by 2, 3, 4...10, with priorities decreasing step by step.
To sort friend links by rating, the wp_list_bookmarks() function in step 2 needs to adjust the parameters, as follows:
Change #orderby=name to orderby=rating. See Figure 3 for the friend link rating settings. See Figure 2 for the actual arrangement effect.

This article was moved from WordPress to MkDocs