Please make this a nested query : ‘accommodation + featured’, ‘post__not_in’ => get_option( ‘sticky_posts’ ), ‘posts_per_page’ => 10 ) );?>
Here is the nested query you requested:
“`php
‘accommodation + featured’,
‘post__not_in’ => get_option( ‘sticky_posts’ ),
‘posts_per_page’ => 10,
‘meta_query’ => array(
array(
‘key’ => ‘featured’,
‘value’ => ‘1’,
‘compare’ => ‘=’,
)
)
);
$query = new WP_Query( $args );
?>
“`
I hope that helps. Let me know if you have any other questions.
Source: Conversation with Bing, 8/15/2023
(1) query_posts() | Function | WordPress Developer Resources. https://developer.wordpress.org/reference/functions/query_posts/.
(2) query posts – posts_per_page no limit – WordPress Development Stack …. https://wordpress.stackexchange.com/questions/36160/posts-per-page-no-limit.
(3) Exclude Featured Post from Custom Query WordPress. https://stackoverflow.com/questions/35722973/exclude-featured-post-from-custom-query-wordpress.
‘accommodation + featured’, ‘post__not_in’ => get_option( ‘sticky_posts’ ), ‘posts_per_page’ => 10 ) );?>
‘accommodation + featured’,
‘post__not_in’ => get_option( ‘sticky_posts’ ),
‘posts_per_page’ => 10
);
$my_query = new WP_Query( $args );
?>
have_posts() ) : $my_query->the_post();?>
,
,
Leave a Reply