WordPress.org

Ready to get started?Download WordPress

Forums

Yet Another Related Posts Plugin (YARPP)
[resolved] [Plugin: Yet Another Related Posts Plugin] Limit loops on a template (5 posts)

  1. hypescience
    Member
    Posted 2 years ago #

    Hello Guys,

    I am really excited with the YARPP possibilities here. The plugin is awsome.

    I want to show related posts on the sidebar as well at the end of the posts. I am using 2 different templates to do so with thumbs. The problem is that I want to show 15 related posts on the sidebar and only 5 on the bottom of the post. Is that a way that I can limit the loop to 5 related posts hard coding it on the template? In that way I would be free to increase to as many as I want in the plugin options to see them on the sidebar.

    The code follows.

    Thanks,

    Marcelo

    [Code moderated as per the Forum Rules. Please use the pastebin]

    http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/

  2. hypescience
    Member
    Posted 2 years ago #

  3. .fay
    Member
    Posted 2 years ago #

    Here is a "dynamic" hard coded template
    http://pastebin.com/asSs73TG

    To limit the loop to 5 posts, rename this file to yarpp-template-thumbs_5.php
    To limit the loop to X posts, rename it to yarpp-template-thumbs_X.php

  4. hypescience
    Member
    Posted 2 years ago #

    Thanks, man. Works really well.

  5. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 1 year ago #

    Very nice.

    Moreover, you can programmatically specify the template being used, FYI. Check the readme for the custom arguments you can pass to the YARPP functions.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic