-
AuthorPosts
-
June 24, 2019 at 10:53 am #1112882
Hi There
I need to sort the Blog Beiträge by Name (descending), but not for the [Magazines].
I added following code into functions.php:add_filter(‘avia_post_slide_query’,’avia_order_by_random’, 10, 2);
function avia_order_by_random($query, $params)
{
$query[‘orderby’] = ‘title’;
$query[‘order’] = ‘DESC’;
return $query;
}But this code is ordering all Blogs (Blog Beiträge AND Magazine)…
————————————————————————————————————————————–
Then i’ve tried to solve the problem with this feed: http://kriesi.at/documentation/enfold/how-to-add-an-orderorderby-option-to-the-blogpost-sliderportfoliomasonry-grid-element/I can’t understand your answer #601296 (It will add sorting option to your element. So you can simply edit your page and then edit the blog posts element that you would like to sort alphabetically and update your page and changes will be applied only to that certain element)
what do i have to to?
Sunny Regards, rosa
June 24, 2019 at 9:07 pm #1113014Hey rosarot,
By magazine you mean the element, right?
Can you show us the page u are usijng it so we can understand. Is everything on the same page?Best regards,
BasilisJune 25, 2019 at 11:48 am #1113204Hey Basilis
Yes, i mean the Magazine-Element to show selected Blogs.
No, there are a lot of pages. And on the most i have
– 1 Magazine-Element (which should be sorted as defined within the Taxonomy Order Plugin)
– 1 Blog-Element (which should be sorted descending by title).Greetz, rosa
June 26, 2019 at 6:07 am #1113478Hi,
Thank you for the update.
The “avia_post_slide_query” filter should NOT be affecting the magazine query because it is exclusive to the post slider or blog posts element. The magazine element query can be adjusted using the “avf_magazine_entries_query” filter.
Best regards,
IsmaelJune 26, 2019 at 1:37 pm #1113606Hi
Thanks for your answer. But if i add the following code to function.php the site doesn’t work anymore:add_filter(‘avf_magazine_entries_query’,’avia_order_by_random’, 10, 2);
function avia_order_by_random($query, $params)
{
$query[‘orderby’] = ‘title’;
$query[‘order’] = ‘ASC’;
return $query;
}Do you have an idea why?
June 27, 2019 at 1:51 pm #1113947Hi,
Thank you for the update.
You have to change the function name “avia_order_by_random” to avoid a duplicate function error.
Best regards,
IsmaelJune 27, 2019 at 2:58 pm #1113966hmmmm… i don’t know what you are meaning. What do i have to change?
Regards, rosaJune 30, 2019 at 5:16 pm #1114607Hi rosarot,
Try the code like this:
add_filter('avf_magazine_entries_query','avia_order_magazine_by_random', 10, 2); function avia_order_magazine_by_random($query, $params) { $query['orderby'] = 'title'; $query['order'] = 'ASC'; return $query; }
Best regards,
Victoria- This reply was modified 5 years, 5 months ago by Victoria.
July 4, 2019 at 9:14 am #1115676Thanks! the problem is solved!! :-)
July 4, 2019 at 1:35 pm #1115754 -
AuthorPosts
- You must be logged in to reply to this topic.