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
- Exclude first post from wp query
- Add css class ID to largest and smallest number a custom field in wp_query
- Category Attachment Pagination 404 Error on 2nd Page
- Add up all numbers from a WordPress query [closed]
- Display posts in correct month order using single date custom field
- Get Current User Id Inside a Loop Returns 0 For a Shortcode
- Random order of WP_Query results with highest meta value
- Custom page archive query by url var calling page twice on one of my custom queries?
- WordPress custom slug (endpoint) and compare all links
- Strip characters, Including spaces, for tel: link
- How can I add multiple ‘tax_query’ arrays via a loop?
- ACF page while loop breaks footer while loop
- Change output based on text field value
- How to query for posts with a null or blank post_name?
- WordPress pagination not working with search page
- get current custom post ID by WP_Query method
- Five posts from a category in footer
- WP-PageNavi is showing the first page only
- How to securely provide a $_POST var in WP_Query with PHP 7?
- Displaying the last post on static homepage
- Using foreach loop breaks
- Using Advanced Custom Fields to create a per page slider
- How can I properly control the numbers and dots that appear in pagination?
- Create WP_Query to search for posts by their categories or their parent/child categories
- WP Query with custom Shortcode
- wp_query with cat not working
- Advanced Meta Query for Large Calendar Website (12k+ posts) (175k+ wp_postmeta rows)
- Increase returned number/pages on pagination
- How to use an associative array in post__in with WP_Query?
- Display PHP within HTML values
- Adding nofollow to a PHP generated Nav
- If Query In Sidebar
- Recent Posts slider, using WP_Query(), loads duplicate sliders
- Why WP_Query(‘showposts=5’) shows only 1 post?
- Logged in user ID as post ID
- Compare post-IDs within WP_Query? (Less than / Greater than)
- Sort query_posts for Parent Pages to menue order or the count?
- Using ajax with paging and a custom sub-query
- WordPress 3.2 query_posts and pagination, permalinks issue
- Unreadable pagination
- ACF: how do I get the fields and its values of a specific group?
- How to use $query->set with post__in?
- Saving an array of dynamic repeater data as post_meta
- Blog post per page setting conflicting with custom WP_Query?
- Loading the same WP_Query in two different wordpress .php templates
- How to prevent WP_Query function from returning all posts when empty?
- Dynamic content based on a URL parameter
- Display a specific category of products in shop page and disable code for specific actions
- Output ACF repeater on frontend user’s profile page (created with Ultimate Member) [closed]
- How to show all pages in blog navigation?
- get_terms pagination
- Remove the first 5 characters of the_title and orderby that
- Add more button if more 8 items
- How to store post ID’s in cookie or session to display the same posts later
- Unread Repeater field IMG alt not working
- Unable to write multiple values back to ACF user field – PHP
- Update grandchild repeater field with value per row
- WordPress, AJAX and pre_get_posts using conditional tags
- Get users that likes the post
- How to use thumbnail size of image if I’m only using src to get image
- Slick + PHP + ACF + JQuery slide reveal not working
- get_posts() and WP_query limits ‘AND’ conditions to a maximum of 6 for meta value queries in WordPress
- Exclude posts based on meta value
- Search not showing all results