• Resolved qtpweb

    (@qtpweb)


    Hello, is there a way to exclude the protected posts on a query ?

    I tried “has_password” false, but I guess the plugin is not using that :

    $args = [
    'paged' => $page,
    'post_type' => 'post',
    'post_status' => 'publish',
    'has_password' => FALSE,
    'posts_per_page' => $qty,
    'tax_query' => $tax_qry,
    ];

    Any tips ?
    Thanks

Viewing 1 replies (of 1 total)
  • Thread Starter qtpweb

    (@qtpweb)

    I found a way to filter the query by adding :

    'meta_query' => array(
    'relation' => 'OR',
    array(
    'key' => 'passster_activate_protection',
    'compare' => 'NOT EXISTS',
    ),
    array(
    'key' => 'passster_activate_protection',
    'value' => '1',
    'compare' => '!=',
    ),
    )

    • This reply was modified 1 year, 1 month ago by qtpweb.
Viewing 1 replies (of 1 total)
  • The topic ‘Exclude a protected post in a query loop’ is closed to new replies.