Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #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

    #1113014

    Hey 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,
    Basilis

    #1113204

    Hey 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

    #1113478

    Hi,

    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,
    Ismael

    #1113606

    Hi
    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?

    #1113947

    Hi,

    Thank you for the update.

    You have to change the function name “avia_order_by_random” to avoid a duplicate function error.

    Best regards,
    Ismael

    #1113966

    hmmmm… i don’t know what you are meaning. What do i have to change?
    Regards, rosa

    #1114607

    Hi 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, 4 months ago by Victoria.
    #1115676

    Thanks! the problem is solved!! :-)

    #1115754

    Hi,

    Great, I’m glad that you got it working. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.