Wordpress: Limit the Related Posts with Ultimate Tag Warrior

Using Ultimate Tag Warrior and using a tag structure in your blog, it's possible to show the related posts to the current article using a tag-based system, so that if there are posts in your blog with the same tags of the current, they are showed below the post.

If you have many articles in your blog, you can limit the number of related posts editing the file plugins/UltimateTagWarrior/ultimate-tag-warrior.php.

When you find the function
function UTW_ShowRelatedPostsForCurrentPost($formattype, $format="", $limit = 0) {

edit it in
function UTW_ShowRelatedPostsForCurrentPost($formattype, $format="", $limit = 10) {

To have a maximum of ten related posts per article
You can also do the same by modifying your template, where you find the line

<ul class="utwrelposts"><?php UTW_ShowRelatedPostsForCurrentPost("posthtmllist") ?></ul>

modify it like this:

<ul class="utwrelposts"><?php UTW_ShowRelatedPostsForCurrentPost("posthtmllist", "", 10) ?></ul>


Bookmark and Share

Lascia un commento

Nome (obbligatorio)

Mail (non sarà pubblicata) (obbligatoria)

Sito web