Hello!
How can I decide the image order on the Feature Image Slider?
I’m using a Feature Image Slider which contents are different categories I have on the page. But I need that one specific category ALWAYS appear in the first slide of the Slider.
I couldn’t find the right help on the older topics .
Thanks in advance!
(sorry for my english)
Andrea
Please, ¿Can anybody help me? :/
Thanks!
Hi,
We are very sorry for the delay.
You cannot alter the order of the items via category but you can do it using custom fields. Add this in the functions.php file:
add_filter('avia_feature_image_slider_query', 'avia_feature_image_slider_query_mod', 10, 1);
function avia_feature_image_slider_query_mod($query) {
$query['meta_key'] = 'featured_slider_order';
$query['orderby'] = 'meta_value_num';
$query['order'] = 'DESC';
return $query;
}
Edit the posts, add a custom field called “featured_slider_order” then add a numeric value (1, 2, 3 or 4 etc) to it. Note that you have to add the custom field in every posts that is included in the slider.
Best regards,
Ismael
Hi Ismael,
I have the same problem here!
I added the code but after that I don’t understand your answer anymore.
Where should I add the custom field? Is it possible to hold one Image at position 1 and after that sort after date DESC?
Thanks in advance!