Try meta_query
to get posts having theme_settings_post_show == true
(for new posts) and theme_settings_post_show
not set at all (for old posts):
<?php
$queryArguments = array(
'posts_per_page' => -1,
'post_type' => 'post',
'meta_query' => array(
'relation' => 'OR', // value is not set or true
array(
'key' => 'theme_settings_post_show',
'value' => '', // can be any value, since it does not exists
'compare' => 'NOT EXISTS',
),
array(
'key' => 'theme_settings_post_show',
'value' => true,
'compare' => '=',
),
),
);
Related Posts:
- meta_box or custom_field as a second tinymce post-instance?
- Create A Metabox For A Custom Field
- Understanding and using metaboxes in posts
- WP_Query orderby not working with meta_value_num and menu_order
- How can I sort posts by the date and a custom meta field?
- How do I correctly set up a WP-Query to only show upcoming event-posts?
- Query Posts With Over 1000 Views
- Query Posts by Custom Field
- How to I retrieve the ID from the Posts page?
- Hide custom metabox value from custom fields
- Get post meta retrieving wrong value
- Show metabox value last post excerpt, title and link
- WP_Query custom field pass the post id
- Why my meta boxes won’t show in front post page?
- Display content between two dates?
- Override WordPress core post-template.php block template
- Adding an option to post editor to show a site disclaimer or message
- How to get value of a selected option from select tag and use it in WP_query to filter posts?
- WP_Query sort by meta_value_num or date
- Creating Ordered Query using Meta_key
- WP Query between posts custom fields [duplicate]
- Order posts by separate menu order for different sub-categories
- How can I create a menu items from meta box based on users input
- Image inside the content is replaced with featured image from my older post
- Should we trust the post globals?
- Add a checkbox to post screen that adds a class to the title
- How to add a new tab to page editor
- Listen to Post action
- Querying post from a multisite network
- How to know if get_posts() failed?
- Show related posts by category but ignore one category
- post__in for get_posts with a dynamic array
- I am trying to create a simple frontend form for posting
- HTML code in Custom field
- Post content being duplicated by the_content();
- 1 column admin screen options – move submitdiv to bottom
- Guest Author – How to modify my custom function code if the guest author URL will follow a particular pattern/format?
- Specific loop in Shortcode
- Sort posts by activity date
- How to add padding between posts
- Working Bootstrap Carousel Conversion to WP – Technical Questions
- Change post format using custom field
- Add few specific post ids to wp_query
- How can I make existing custom fields easier to edit/add in my theme?
- What Can I Use To Add A Custom Button Between Publish button and Move To Trash?
- Save list from a custom meta box?
- WP_Query posts_per_page ignored
- wp_query ‘s’ parameter does not work with custom post type
- Add custom field automatically (add_post_meta) with value based on number of words of article
- WP_Query get posts from custom posts by category
- Accessing post->ID outside of the loop for listing child pages
- Limiting the number of posts in WP_Query leads to unexpected result
- List posts in a given category
- Reset Popular post query?
- Query Posts multiple conditions
- Dashboard :10 Last draft page and 10 last pending review page (metabox)
- Guest Author – How to display posts on /author/ archive page
- Future post ID not showing
- Search by post title and content in wp_query without order
- How safe is renovating $wp_query when doing WP_Query pagination in Page Template
- posts_per_page option limits the number of Gallery items
- wp_query random post
- how to get post order by post id wp_query?
- Possible to alternate between two loops
- How to display all posts divided/ordered by post date? [closed]
- Customize rel=canonical tag for single blog post
- Is it possible to use WP_Query to only pull posts with attachments?
- Every second post different class in blog view
- Get post ID from a link
- Display posts of specific category term
- Can’t understand why sometimes a [caption] field appears
- Why in my query is display two title?
- wp_query with ajax
- Updating post meta for checkbox
- How to convert query sql to shortcode in wordpress?
- Use posts_where to exclude posts ids from wp_query
- Adding JS functionality to the Publish button in wp-admin/post.php
- Why does WordPress search returns same number of results for every search query?
- Sidebar limiting to 10 posts?
- Change Old WordPress Post Date Year
- Display/Filter post using if else statement
- Search results for ACF data
- Query prints posts without specific categories
- Numbered Pagination Showing The Same Posts After Altering WP_Query
- Need to display a Jan 1st post as the site’s front page on Jan 1st, and Jan 2nd post as front page on Jan 2nd etc
- How do you update post date (year only) in a separate custom field?
- How do I display posts ordered by a date custom field?
- Loop through all posts showing duplicates
- Manipulate query to show specific post
- WordPress text field in array problem
- Random order of the 5 most popular posts
- My custom query is displaying random posts in random order
- Get query result according to merged array
- Meta boxes not saving
- How to show the posts list into a static page? Problems to use the loop into a static page
- Displaying Results From Custom Taxonomy Query
- Multiple loops on a Search result page?
- WP_Query: Fetch posts that are in (category1 and not in category2), OR posts that are not in cagegory1
- How do I show the post title if an advanced custom field hasn’t been used?
- How add class the_content();?