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)
- How to get ACF field to show up on all posts on front end?
- get_the_tags() not iterating through for/while loop, but will with foreach
- get a simple array of all of the term names that exist in all taxonomies
- Populate dropdown with Child Pages based on Parent Page chosen
- Unreadable pagination
- 200 Rewrite blog post links
- ACF: how do I get the fields and its values of a specific group?
- How to set a min number of words for a blog post
- How to use $query->set with post__in?
- Loop through categories and display posts title under each dropdown
- Get post id in a function when edit/add a post
- Why do WP_Query results change after updating unrelated Advanced Custom Fields (ACF)?
- how do I get a specific post from a post with a subcategory in WP
- Saving an array of dynamic repeater data as post_meta
- Automatically create child pages and grandchild pages when saving a (parent) page
- Reprinting tags with all attributes
- wp_trim_words() does not work with my code Am I doing any mistake in my code?
- Second transition_post_status hook fired instead of the first
- Output ACF repeater on frontend user’s profile page (created with Ultimate Member) [closed]
- Remove the first 5 characters of the_title and orderby that
- 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
- PHP Array Returning [object Object]. Tried existing answers results with no luck
- Which hook/action will help me solve my problem?
- foreach loop still echoes array
- How can I add extra word in permalink when someone click download button?
- Update grandchild repeater field with value per row
- How to use thumbnail size of image if I’m only using src to get image
- Post + form + action + results on the same page
- Slick + PHP + ACF + JQuery slide reveal not working
- Open post-content in archive page in a Modal box with bootstrap
- Exclude posts based on meta value
- remove post that has no content
- Checking array against author id in loop
- Loading index.php contents which located outside blog folder for post single page
- get post content of particular post by url
- Post repeating with infinite scroll
- Custom posts in different columns style
- Get children post mime type using parent post_ID wp_post
- How to show only subcategories in parent category not parent category?
- 404 error when I acess the second page of post-type
- Sort by page information by Ascending Numbers
- Alter required message using comment form api
- Which PHP page is the Default Posts Page
- Advanced Custom Fields not displaying
- meaning of (array)function()
- retrieve post data and insert it in seperate static html page without WordPress
- Grouping posts by a custom meta value
- WP Insert Post and then go to post
- Why am I getting a different filename? And how does WordPress load singular.php for both Page & Post? (Fresh WordPress installation)
- Returning data instead of echoing/printing
- Display related posts without a plugin
- wp_force_remove_style’ not found
- Counting Search results, and displaying the offset per page
- Download PDF after CF7 form submission
- How to fix this warning:call_user_func_array() expects exactly 2 parameters, 1 given in D:\wamp\www\…….\wp-includes\class-wp-hook.php on line 286
- How can I access string value in an array?
- Count posts on multisite with blog id
- Function works everywhere, how to keep it to execute when creating a new post
- Making (and edit existing) posts with ID included
- How to use if statement in an array? [closed]
- Copy taxonomy terms from one post to another programmatically
- How to array only one key from another array
- Filtering a function’ output for a new continued function
- How to create an ACF shortcode with Repeater Field in WordPress? [duplicate]
- Parsing Menu Items and Blog Posts
- Pagination on Custom Post
- Get html data with javascript to php array and store to wordpress database
- $wpdb returns duplicate posts
- How to avoid duplicates when creating recent network posts
- How to show an entire post content and not also the excerpt?
- Get latest post from all categories except one
- What file have I to create in my custom WordPress theme to show all the post belonging to a specific category?
- Update post title from external file?
- Parse error: syntax error, unexpected end of file
- How do I create a numbered list with PHP? [closed]
- Why is an array created in a function hooked to customize register populated when customizer is loaded but not when the front-end is loaded?
- How to use array in function to get only value I want
- Error while setting role
- Get categories names as an array to use it in theme settings
- Upload non-featured image to image field
- Automatically add images to a menu