Replies: 0
Hi !
Theme : Customizr 3.5.1
Website : http://www.92bulles.fr
I’ve add the slider to the main page of the website and the limit seems to be 11 but I’ve fix this value to 5 ?
Here is the code integrated to the page :
[recent_post_slider limit="5" design="design-3" category="news" show_category_name="false" show_content="true" show_date="true" dots="true" arrows="true" autoplay="true" autoplay_interval="5000" speed="1000" content_words_limit ="40" post_type="post" show_author="false"]
I use a child theme with a function.php file and there is 1 function with posts_per_page
/*** Filtre widget par categorie */
add_filter( 'widget_posts_args', 'my_widget_posts_args');
function my_widget_posts_args($args) {
if (has_tag('annu') ){//filtre les articles ayant une catégorie annuaire
return array(
'orderby' => 'post_title',
'order' => 'ASC',
'posts_per_page' => 100,//set the number you want here
'no_found_rows' => true,
'post_status' => 'publish',
'ignore_sticky_posts' => true,
'cat' => '11'//the current category id
);
}
elseif ( is_category( ) ){// si les articles ont une autre catégorie
$cat = get_queried_object();
return array('posts_per_page' => 10,//set the number you want here
'no_found_rows' => true,
'post_status' => 'publish',
'ignore_sticky_posts' => true,
'cat' => $cat -> term_id//the current category id
);
}
else { //Si les widget ne sont pas liés à une catégorie
return $args;
}
}
Could you help ?
-
This topic was modified 4 minutes ago by
Tandhruil.