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
- Removing noindex posts from wp_query
- How to get Metabox custom field to show checked if value is updated using post meta query?
- WP Query – Posts Per Page not working in combination with category__in
- Ajaxify This Code
- Automatically add custom fields value to wordpress post
- Meta value does not save for scheduled posts
- How to filter my search in post if contains a word in title, content or excerpt?
- How to return another post than requested
- Is there a way to notify specific users when new posts are published to specific pages?
- Pausing and Resuming WP_Query results
- How to do set post permalinks using 6 digit random unique function?
- Select only post id and meta value with WP_Query
- Lost draft under all posts and drafts
- Get user categories with most posts in it
- Random ajax load only works with posts_per_page set to -1
- MySql query to get posts with all meta and terms
- How to : pagination in 3 different custom loops on the same page
- Categories list into registration form
- Add a custom meta box in the post options that loads some html code in the header
- How safe is renovating $wp_query when doing WP_Query pagination in Page Template
- Exclude the first ‘n’ number of posts of a tag from home page?
- Query posts and return XML
- Simultaneous admin updates causes custom fields to not update
- how to change the number of posts returned in a specific loop without making it global?
- Cannot retrieve a custom RSS field from posts
- posts_per_page option limits the number of Gallery items
- List authors with the last post title and order by last post date
- How to order posts by meta_value and title
- Hooking into the post editing screen for an existing page only
- wp_query random post
- wp_posts table: safely remove unused columns to save database storage
- Adding a blog archive with pagination using WP_Query
- How to get Tags with specific post id
- Redirect to another page using contact form 7? [closed]
- how can i change WP main archives loop to sort by name or title
- Using wp_list_pages() after calling query_posts()
- how to get post order by post id wp_query?
- Possible to alternate between two loops
- Nested WP_Query breaking loop
- WordPress query_posts by tag doesn’t work anymore(?)
- How to rate a post from Admin Side / Manually?
- How to display all posts divided/ordered by post date? [closed]
- Why Query is returning empty array?
- How do I extract just the post ID of the first item in whatever WP_Query returns?
- Show post content and title in diferent divs using WP_Query using a loop
- Customize rel=canonical tag for single blog post
- How to save meta checkbox WordPress
- Why are my paginated posts always returning the same results?
- Ignore latest two posts
- Is it possible to use WP_Query to only pull posts with attachments?
- Show posts by author of membership level (Paid Membership Pro)
- Inner join overrides Advanced Custom Fields plugin’s get_field [closed]
- meta_value timestamp older than now
- Every second post different class in blog view
- Get post ID from a link
- Loop doesn’t exclude the specified category in home page
- Get posts with multiple categories
- Do not show children of a category
- Display posts of specific category term
- Create a list of posts with topic headdings
- Add field to user meta table in database when link is clicked
- Is there a way to create a meta box that can be added multiple times to a post dynamically?
- Print out last 3 blogposts
- why the same code got different results when using query_posts in functions.php and index.php
- Query posts by Author and/or by Tag
- Query for first 3 posts to change the look and feel
- How to get posts published on the latest date?
- Why posts array is empty?
- Can’t understand why sometimes a [caption] field appears
- Page and post loop same template
- Edit multiple custom post types while saving a new or edited post
- Upload attachment from external site
- Getting blog pagination to work on page set as front page
- How to group only VISIBLE posts? [closed]
- How to check in functions.php if there is data in a WP_Query?
- Shortcode with ‘year’ parameter