Featured Posts Pro free WordPress plugin
Description
Featured Posts Pro free WordPress plugin
Featured Posts Pro
allows administrator and editor an option to set posts, pages & custom posts as a featured posts very easily. Posts, pages & custom posts can be set as featured posts using a checkbox on the posts list page or on the edit page of the post. Please see screenshots to be more clear.
Featured Posts Pro
also adds a widget that will list the recent featured posts. This is similar to the default recent posts widget except this widget displays recent featured posts instead. The template for the Featured Posts Pro Widget can be customized with your theme.
How to use in the theme
You can to get the featured posts, you need to make a custom query as follows
sample code to get the featured posts with orders
`$args = array(
‘post_type’ => ‘any’,
‘posts_per_page’ => 10,
‘no_found_rows’ => true,
‘post_status’ => ‘publish’,
‘ignore_sticky_posts’ => true,
‘meta_query’ => array(
array(
‘relation’ => ‘OR’,
array(
‘key’ => ‘post_featured_position’,
‘compare’ => ‘EXISTS’
),
array(
‘key’ => ‘post_featured_position’,
‘compare’ => ‘NOT EXISTS’
),
),
array(
‘relation’ => ‘AND’,
‘key’ => ‘is_post_featured’,
‘compare’ => ‘=’,
‘value’ => 1
)
),
‘orderby’ => ‘meta_value_num’,
‘order’ => ‘ASC’,
) ;
$featuredPosts = new WP_Query( $args );