Hi Dimitri,
I want to have several different sliders in my pages, sorted by date, title,likes,comments,random or some other query
I have this in my functions
add_filter('new_royalslider_posts_slider_query_args', 'newrs_custom_query', 10, 2);
function newrs_custom_query($args) {
// $args is WP_Query arguments object.
// feel free to change them here
$args = array(
'orderby' => 'views',
'posts_per_page' => 10
);
return $args;
}
add_filter('new_royalslider_posts_slider_query_args', 'newrs_custom_query', 10, 2);
function newrs_custom_query($args) {
// $args is WP_Query arguments object.
// feel free to change them here
$args = array(
'orderby' => 'likes',
'posts_per_page' => 10
);
return $args;
}
But it seems the last function is overwriting every other slider, how can I target the custom query for each slider, Am I missing something.
I was also wondering what this arguments are "newrs_custom_query', 10, 2);" , the 10 and 2 ?
Thanks
Vidal
from www.gp-live.com
.
help.dimsemenov.com
No comments:
Post a Comment