• Hi

    I need to use YARPP in two different areas of my site with different settings and layout.

    I would like to programmatically add them in the php code and set the individual settings and different custom templates in the code.

    Can I set the custom template in the code? What is the code to do this?

    Can you refer me to a full list of properties of the function that I can reference and call in the code? I have searched but cannot find.

    Thank you for all your help

    https://www.ads-software.com/plugins/yet-another-related-posts-plugin/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter NaamaGold

    (@naamagold)

    I tried adding this

    related_posts(array('template_file'=>'yarpp-template-xxx.php'));

    which I found here but the page is not loading my template file but rather the file in settings.

    Is there a special way to configure the settings so it wont override this? or is my code wrong?

    Surely this is a fairy common need?

    Plugin Author YARPP

    (@jeffparker)

    The template files you want to use must be moved into your active theme’s main directory. They cannot be in a subdirectory but must be loose in that theme’s directory.

    Hope that helps.

    Thread Starter NaamaGold

    (@naamagold)

    Thanks jeffparker, I already have them there. If I change the settings to custom it loads my file in the dropdown and the template works fine.

    I just cant seem to load it programmatically and override the settings in the admin.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘programmatically choose custom template?’ is closed to new replies.