Ok, I figured it out myself. So maybe I can help someone out with the same question.
I made a custom field TRUE / FALSE called “featured”.
In facet WP I created this query:
<?php
return array(
'post_type' => 'custom_post_type',
'post_status' => 'publish',
'meta_query' => array(
'is_featured' => array(
'key' => 'featured',
'compare' => 'EXISTS'
)
),
'orderby' => array(
'is_featured' => 'DESC'
)
);
In FacetWP I used a simple if statement for the featured div:
<?php if ( get_field( 'featured' ) ): ?>
<div class="default-class featured">
<?php else: ?>
<div class="default-class">
<?php endif; ?>
Maybe not the best way to do it but it worked for me.
Related Posts:
- Using a javascript file to access a get posts array
- Can an array be used as a meta_query value?
- How can I add multiple ‘tax_query’ arrays via a loop?
- Redirect to another page using contact form 7? [closed]
- Advanced Custom Fields – display label and value only if value entered
- Only show first image in foreach loop
- Conditional multidimensional arrays and array_map
- Get the id of all images in a post
- how to make an array of post id’s in is_single
- array_rand not working correctly?
- Update value of a associative array with update_post_meta
- Query on a repeater date (acf)
- ACF – Get ID of relationship field in flexible content
- Get list of posts from attachment
- Display a single row from nested array of custom field data
- Page returning ID from array, how to return the correct values for post in acf wordpress
- Custom WordPress Function – Adding items from Foreach Loop into an array and Updating Field based on array of IDs (ACF + WooCommerce)
- Disable Attachment Pages Completely
- Inject post (from specific category) between posts in Loop
- Remove option to allow trackbacks/pingbacks from post page options
- Metabox repeating fields – radio buttons not saving correctly
- How can merge two arrays values in one array and save in database
- How to get year, month and hour in WordPress?
- Compare two meta key values against each other inside the get_posts array?
- Advanced Custom Fields Image Field returning ID instead of URL [closed]
- Print number of post (in reverse)
- Count number of published posts by type
- Automatically generate Post/Page from searched Database item?
- List of posts by day of the week
- Get taxonomy terms only of the WP_Query current posts
- ACF check if variable has http, if else return string
- How to get 2 or multiple custom post types in wordpress functions.php
- Displaying a button on each post
- Creating bulk posts with Youtube videos
- Create shortcodes within foreach loop (using array)
- Getting a specific post values to another div or modal
- Unreadable pagination
- ACF: how do I get the fields and its values of a specific group?
- how do I get a specific post from a post with a subcategory in WP
- Reprinting tags with all attributes
- Remove the first 5 characters of the_title and orderby that
- Open post-content in archive page in a Modal box with bootstrap
- Checking array against author id in loop
- Grouping posts by a custom meta value
- Error while setting role
- Automatically add images to a menu
- How to use two meta_compare in an array?
- ACF put a comma after the last repeater field value [closed]
- Show ACF field with link to ultimate member profile/WordPress user profile below the post (single post layout)
- Loop over Array and get the distinct ids
- Store metakey value as an array
- Remove empty terms from array, sort alphabetically, update back to repeating field
- Filter by field with array value in ACF on WP REST API
- create front-end users post list by specific category
- show recent posts php code error?
- Error display post thumbnails for previous and next post
- Post to WordPress from another Server via PHP
- Only load certain artists on this page
- add the value of a variable returned in a while loop [closed]
- Including Custom fields within the_content
- Wrap posts p tags in div
- using images in next/previous_post_link [closed]
- Update user repeater meta (ACF) with another user meta field value
- Convert a column of a table containing an Array as response in HTML
- Generating 10 000 WordPress posts using PHP and avoiding Server Timeout error
- If Post Published Date or Modified Date is 1 Year or Older, Display Notice on Post Page
- Filter wordpress posts without searching the keywords in the post content
- Display just one post from a loop of 5 posts?
- ACF Taxonomy field values not select in backend
- Use WPQuery to match to specific repeater row in post
- How to get post titles by post ID and integrate with my code?
- How to insert multiple rows and columns in database using array
- Infinite looping next post link within a certain category on a post
- Advance custom fields variable with if statement & Function
- Enqueue script only on child pages of custom post types
- Attach and retrive multiple pdf files to post or page
- Place product field value as variable in php
- Replace an array (with identical values) with another array in the_content
- How to output values from a loop into a javascript array
- How to use a PHP file to control the content of a blog post
- Displaying POST content with HTML tags and all
- get_users when from meta key that has serialized values
- make an array in wordpress cusmization api?
- Position a repeated article blocks
- Pagination in WP Queries
- Add div after every 4 posts then every 2 posts for a responsive loop
- How to replace hard-coded list of custom taxonomy terms based on custom field query [closed]
- ACF Images If/else
- Can’t put a hyperlink on Featured Post’s Image
- WordPress get_post_meta issue
- Unserializeing multiple column values that are stored in one database results variable
- Display pages from specific page template
- the_post_thumbnail unless video id is added
- get_permalink returning first letter
- Add comma between variables [closed]
- ACF | WooCommerce | Theme Development | How to include a /template-part/ that makes use of ACF’s on a custom WooCommerce homepage?
- How to display the date under the post title?
- Add multiple HTML attributes to an Elementor button
- advanced custom fields: repeater field within conditional statement [closed]
- Adding date and time to the same request