Troubleshooting post meta-values

Support General Troubleshooting post meta-values

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #3082
    jonwatson87jonwatson87
    Participant

    I'm having some problems filtering posts based on the value of a meta checkbox.

    Essentially, I only want posts to show up if the "archived" checkbox isn't ticked.

    This seems to work fine on most templates, but for archive.php and tag.php I just can't get it to work properly. pre_get_posts just doesn't want to filter based on these values.

    To troubleshoot this, I want to echo the number of ticked and unticked checkboxes to the front end.

    What's the best way to echo number of posts that meet the below criteria to the front end using a test template?

    Echo number of posts where epi_pubarchive != 0
    Echo number of posts where epi_pubarchive == 1

    (I have multiple custom post types, so ideally the solution will incorporate all of them!)

    #3083
    jonwatson87jonwatson87
    Participant

    Nevermind! I think I've figured it out 🙂

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Troubleshooting post meta-values’ is closed to new replies.