mirror of
https://ghproxy.net/https://github.com/AlxMedia/airl.git
synced 2025-08-26 16:49:27 +08:00
fix theme option include/exlude featured posts from content
This commit is contained in:
parent
8164b15461
commit
b4a7efb2f6
3 changed files with 8 additions and 8 deletions
|
@ -511,7 +511,7 @@ if ( ! function_exists( 'airl_get_featured_post_ids' ) ) {
|
|||
function airl_get_featured_post_ids() {
|
||||
$args = array(
|
||||
'category' => absint( get_theme_mod('featured-category','') ),
|
||||
'numberposts' => absint( get_theme_mod('featured-posts-count','0')),
|
||||
'numberposts' => absint( get_theme_mod('featured-posts-count','7')),
|
||||
);
|
||||
$posts = get_posts($args);
|
||||
if ( !$posts ) return false;
|
||||
|
@ -629,11 +629,11 @@ if ( ! function_exists( 'airl_pre_get_posts' ) ) {
|
|||
if ( $query->is_home() ) {
|
||||
|
||||
// Featured posts enabled
|
||||
if ( get_theme_mod('featured-posts-count','0') != '0' ) {
|
||||
if ( get_theme_mod('featured-posts-count','7') != '0' ) {
|
||||
// Get featured post ids
|
||||
$featured_post_ids = airl_get_featured_post_ids();
|
||||
// Exclude posts
|
||||
if ( $featured_post_ids && !get_theme_mod('featured-posts-include') )
|
||||
if ( $featured_post_ids && get_theme_mod('featured-posts-include','off') =='on' )
|
||||
$query->set('post__not_in', $featured_post_ids);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue