WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. carletto0282
    Member
    Posted 2 years ago #

    Hi,

    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!
    Carlo

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

  2. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 2 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

About this Topic