Use WP_Query instead, and you can use the meta_key / meta_value parameters:
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'cat' => 10,
'paged' => $paged,
'posts_per_page' => 12,
'post_status' => 'any',
'order' => 'ASC',
'meta_key' => 'archived',
'meta_value' => 'true'
);
$posts = new WP_Query($args);
?>
<?php while($posts->have_posts()): $posts->the_post(); ?>
<?php the_title(); ?>
<?php endwhile; ?>
Related Posts:
- Pagination in category.php not functioning
- /page/2/ redirect to 404
- Build a content and excerpt grid loop with paging and options for # of posts
- how to display active, upcoming and past event with featured listing with pagination
- Can an array be used as a meta_query value?
- Sorting Posts | Alphabetical Order
- Looking for most performant way to execute several similar WP queries within shortcodes
- Can’t search posts using WP_QUERY inside AJAX Function
- Using loop pagination on single.php
- Why do WP_Query results change after updating unrelated Advanced Custom Fields (ACF)?
- WP_Query adds “(wp_posts.ID = ‘0’)” so no results are returned
- Sort by page information by Ascending Numbers
- How to get all author posts outside of author templates
- How to get post ID in a Page?
- the_posts_pagination() not working in wpquery
- Form search query – displaying ACF “Post Object” field as results
- ACF Repeater Pagination stopped working since upgrade to php7.2
- change the default order of posts only for specific categories
- Custom query vars filters problem with pagination
- posts_nav_link pulling in multiple post types
- search.php to search only the post title
- How to work Woocommerce pagination inside shortcode?
- Nested Queries of decreasing specificity
- Load more posts using AJAX based on posts inside WP_Query
- WordPress sorting posts by date and title using a dropdown
- Use WPQuery to match to specific repeater row in post
- Query on a repeater date (acf)
- Trying to get pagination working on WP_Query() post grid
- List all ACF field values across every post on one page
- Ordering / grouping posts by datepicker ACF
- Create a hierarchical loop at predefined markup requirements
- Custom query_posts() parameter
- Does wp_query and query_posts affect website performance? [duplicate]
- WordPress post pagination on custom template not working
- How to modify this function to exclude also the post belonging to a specific category?
- How do I exclude the current post from the upcoming post query
- Best Practice for PHP
- Using OR conditions in meta_query for query_posts argument
- Conditionally loading JavaScript based on the Advanced Custom Fields in the post
- How to create a WP_Query to search the Title or Tag?
- Is there a reason why my wordpress PHP page isn’t loading into my PHP template
- Changing Link Attributes for Wp_Link_Pages
- Get list of WP Updates Across Sites
- How to Explode a Textarea Field and Echo each line separately, wrapped with HTML
- WP_Query sort using multiple numeric meta values
- How to get to a specific position in wp_query?
- WP_Query loop, does not display special characters in title correctly
- Remove query string specific key value
- WordPress pagination showing same posts on each page
- How to filter posts by post format “standard” from wp-json api?
- Importing hard coded custom field into acf field
- Five posts from a category in footer
- Displaying the last post on static homepage
- Using foreach loop breaks
- Saving an array of dynamic repeater data as post_meta
- Blog post per page setting conflicting with custom WP_Query?
- Unread Repeater field IMG alt not working
- Get users that likes the post
- Slick + PHP + ACF + JQuery slide reveal not working
- inserting a post from an extern php file but post content doesn’t show on wp site
- Pagination for custom shop loop woocommerce
- How to create an ACF shortcode with Repeater Field in WordPress? [duplicate]
- Prev/Next Links Broken on Static Front Page Pagination
- Can I set up a hover animation in CSS depending on a PHP conditional?
- Conditional multidimensional arrays and array_map
- extract serialized array to use for wp-query
- ACF Unexpected T_CONSTANT_ENCAPSED_STRING [closed]
- Limit the number of child pages
- Using multiple variables to assign categories to an array
- Search.php gets metadata from first post
- the_post(); prints out style text into my HTML?
- Optimising WP_Query with ACF Fields
- Pagination at category doesnt work with same name of page
- WordPress Search Ajax + Isotope + InfiniteScroll
- Problems updating nested ACF field groups
- WordPress create custom XML RSS feed template
- How to call my PHP function with AJAX ? wp_query
- can I extend the WP_Query class to deal with ‘duplicate’ posts created by joining to wp_posts?
- Advanced Custom Forms PHP formatting for do_shortcode
- Get field value and use as variable in php
- ACF Gallery field images donwload
- ACF under category name in shop page [closed]
- WP_Query To Display Product Of Brand On Taxonomy Page
- ACF background-color per post in a WordPress loop
- How to display last whole post on the homepage
- WordPress Single Post Pagination Numbered and Navigational
- ACF + WP + Slick Slider Repeater Slide Group PHP not Displaying [closed]
- wp_query beginner
- WooCommerce – Print Processing orders [closed]
- List of child pages fetch next results at link click
- How to exclude post from being queried based on custom meta value
- How to get category pages to look like a certain archive page?
- Pagination on Custom Loop
- Post Title Not showing up
- Advanced Taxonomy query, with 3 post types
- reorder a WP_Query, using a dropdown
- Order woo products, but first products must be with acf fields
- query_posts different amount of posts per page [duplicate]
- Display biography post for today’s birthday person
- Show button in header when product custom field is not empty