Yet Another Related Posts Plugin (YARPP)
[resolved] [Plugin: Yet Another Related Posts Plugin] Check for a custom value (2 posts)

  1. carletto0282
    Posted 3 years ago #


    is there a way to add a check for a custom value (let's say a custom field) in the query for related post?

    Thanks in advance
    best regards!


  2. mitcho (Michael Yoshitaka Erlewine)
    Plugin Author

    Posted 3 years ago #

    Unfortunately the query for related posts is quite complex, so I do not recommend you check for a custom field, which would require joining another table. This would require creating multiple, potentially fragile filters.

    What you can do instead, though, is if you want to, for example, only display related posts which have a particular custom field value, use a YARPP template: inside the Loop in the template, check for the custom field. If it has the value you want, print the link. Otherwise, don't, and it won't be seen.

    Hope that helps.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Yet Another Related Posts Plugin (YARPP)
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic