A simple hack. Edit: putting the featured post ids in an array and checking that array in the main loop.
global $post;
$post_IDs = array();
foreach($post_info as $post_info_obj) {
$post_IDs[] = $post_info_obj->ID;
}
$featured_IDs = array();
$query1 = new WP_Query(array('meta_key'=>'sticky','meta_value'=>'featured','post__in'=>$post_IDs));
while($query1->have_posts()) {
$query1->the_post();
$featured_IDs[] = $post->ID;
get_property_info_li($post);
}
First thing do to in the main loop: if the post is featured, skip it.
if(in_array($post_info_obj->ID,$featured_IDs)) { continue; }
Related Posts:
- Extending the search context in the admin list post screen
- Advanced search form with filters for custom taxonomies and custom fields
- How can I change the admin search posts fields?
- Development of a WordPress Search Plugin – Best Practices
- Admin Area Custom Type Search By Meta Fields Without Title & Content
- Search multiple custom fields by using meta_query
- How do I Paginate Search Results for Custom Post Types?
- Search that will look in custom field, post title and post content
- Search everything (posts, pages, tags, cpt, meta)
- Search Custom Post Type with all meta attached?
- WordPress Search documentation: how to improve search query using taxonomy terms, custom meta fields?
- Backend search; include CPT meta?
- How to use custom fields to enable sticky posts on custom post types?
- Search Custom Post Type Custom Fields
- Custom Fields vs Separate Table
- Including Custom Meta with posts_where query
- search also in taxonomy, tags and custom fields
- Filter custom posts using auto populated dropdown selectors
- Including metaboxes from custom post types in global search — continued
- Displaying and searching Custom Posts
- Searching Custom Fields
- filter search custom field query
- How to let users choose where to search for posts?
- Add custom attributes to a post
- Custom Taxonomy Search result page
- search custom post type by custom fields on front end
- Category Search / Custom Post Type search on my website. Custom Post Types that are “page-like”?
- Best way to create a search for custom post type by custom field values
- Filtering custom posts by custom fields (ACF) [closed]
- Search CPT Title AND Meta
- Advanced search form with multiple custom fields
- Search facility with directories
- Search form to find custom meta box generated data
- Is it good practice to search for custom posts based on custom field values?
- Advanced search form with filters for custom taxonomies and custom fields
- How do I set the default admin sort order for a custom post type to a custom column?
- WordPress 4.4+ : How to revision CPT + metadata
- Filter a custom field based on selection of another custom field (ACF) [closed]
- Detect meta value changes when post is updated (post_updated)
- Custom field being erased after autosave
- How to select one major category (or custom taxonomy) for a custom post type?
- front end radio custom taxonomy with custom post type
- Search Post Title Only [duplicate]
- Displaying Meta Box Image
- Display posts if a custom field value is equal to another custom field value
- Custom field default value with counter
- Custom meta fields for specific custom type only
- Check if a specific custom field exists?
- WordPress Create Post from front-end
- How to insert content from another Custom Post type into Post?
- Using several custom fields as custom post title
- How to bulk copy custom fields between custom posts?
- Calculate all custom field values in the post loop
- add custom field to custom post type
- Multiple meta_values in the pre_get_posts filter?
- How to order separated Custom Post Search results
- Role scoping for contributors down to the field level
- Custom post type search using $_SESSION and pre_get_posts
- Callback to custom field is not working in WordPress REST API
- Cannot save CPT meta box
- custom comments form for custom post type
- Search one custom post type ONLY, disable “all posts”
- Enable Custom Fields For Custom Post Type When CPT Created Using Plugin
- Submitting Custom Post Types with custom fields from Front-end form
- post_per_page ignored in WP_Query
- Sort custom post type by most current date picker
- Remove default WYSIWYG editor without removing custom fields editors
- Display custom meta on page that has been check in custom post type
- How do I update_post_meta() or add_post_meta() with an AJAX call
- Automatically add a character to field in edit post page
- Change Post Meta via AJAX from the posts list table
- Saving metabox keys and storing values as array
- Redirecting search to specific templates with $_GET[“post_type”]
- Mandatory field in Custom post
- How to store the third party script with HTML code in the wordpress custom input field?
- WP Query from two Custom Post type fields as statement
- How To Read Read Custom Post Type Data in Headless CMS Mode
- Filter custom post type admin list by custom meta column, where the column is another custom posts meta value
- How to display custom field in product description?
- Add custom template ‘sub-page’ to Custom Post type?
- WP_List_Table Inside Metabox Not Working on Clicking Search Button
- Where is get_post_meta value located?
- post_type incorrect for custom post type
- Live search by custom tag
- Adding a Section for Visitors
- Automatic Set Category For A Custom Post Type
- how to create custom taxonomy drop downs for parents and child
- Sort loop by custom field from different post type
- WordPress loop, show only one post per custom field
- Extensive search filtering and results->PDF in the front-end
- one get_posts to return a number of custom posts for each meta value
- Is it possible to make one of two custom fields in Custom Post Type UI Required but not the other?
- Get result from Custom Field in Custom Post type
- How to grab data (titles, thumbnails and custom fields) from multiple posts to populate a new array efficiently?
- How do I do this?: If custom post type exists, echo it, else do not
- How to get lowest price from custom fields of posts
- Display ACF object field data using Elementor Custom Query
- Sortable admin columns ordering from custom fields isn’t combine com search and Dropdown filter
- WordPress custom field sorting, weird behavior: the latest post is at the end
- I want to understand plugin implementation of custom posts / taxonomies / metaboxes