Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #642141

    Hi there,

    I’d like to arrange the sort options (when using masonry or portfolio grid) by my own preferences. At the moment they appear in alphabetical order. I need these categories but in an individual sequence as a filter.

    Any hinds?

    Kind regards,
    Magnolia

    P.S.: It tried this – but wasn’t successful.

    add_filter(‘avia_masonry_entries_query’, ‘avia_masonry_custom_query’);

    function avia_masonry_custom_query( $query ) {
    $query[‘orderby’] = ‘name’;
    $query[‘order’] = ‘ASC’;
    return $query;
    }

    –> http://kriesi.at/documentation/enfold/change-the-sort-order-of-masonry-elements/

    • This topic was modified 7 years, 10 months ago by Magnolia.
    #642275
    #642330

    Dear Yigit,
    I see no change in the order of the sorting options – unfortunately :(
    Any other idea?

    Thank you so much!
    Magnolia

    • This reply was modified 7 years, 10 months ago by Magnolia. Reason: add access to WP
    #643048

    Hi,

    Use the following plugin then go to the Portfolio > Taxonomy Order panel. Sort the portfolio categories manually: https://wordpress.org/plugins/taxonomy-terms-order/

    Best regards,
    Ismael

    #643120

    Thank you Ismael,

    that’s it!!! It worked :)))

    So you can close this call :)

    Thanks a lot!

    Best regards,
    Magnolia

    • This reply was modified 7 years, 9 months ago by Magnolia.
    #643318

    Hi Magnolia,

    Great, glad you got it working :-)

    Best regards,
    Rikard

    #1192804

    Hello there,
    I have the same problem.
    Unfortunately the mentioned plugin (https://wordpress.org/plugins/taxonomy-terms-order/) doesn’t work on my website.
    Can you help please.
    Thank you!

    #1193278

    Hi Jables,

    Please start a separate thread, describe your issue there and give us a link to your website.

    Best regards,
    Victoria

    #1193290

    i use – if there are not so many portoflio /post a plugin called Intuitive custom post order.
    Günter told me that f.e. : https://de.wordpress.org/plugins/simple-custom-post-order/ this is a good alternative.
    You can drag and drop on the post / portfolio list the entries to the place your need.

    #1193295

    on the other hand if the order option you need is a kind of system i use this in child-theme functions.php:

    function avia_custom_query_extension($query, $params)
        {
            global $avia_config;
            if(!empty($avia_config['avia_custom_query_options']['order']))
            {
                $query['order'] = $avia_config['avia_custom_query_options']['order'];
            }
            if(!empty($avia_config['avia_custom_query_options']['orderby']))
            {
                $query['orderby'] = $avia_config['avia_custom_query_options']['orderby'];
            }
            unset($avia_config['avia_custom_query_options']);
            return $query;
        }
    
        add_filter('avia_masonry_entries_query', 'avia_custom_query_extension', 10, 2);
        add_filter('avia_post_grid_query', 'avia_custom_query_extension', 10, 2);
        add_filter('avia_post_slide_query', 'avia_custom_query_extension', 10, 2);
        add_filter('avia_blog_post_query', 'avia_custom_query_extension', 10, 2);
        add_filter('avf_magazine_entries_query', 'avia_custom_query_extension', 10, 2);
        add_filter('avf_template_builder_shortcode_elements','avia_custom_query_options', 10, 1);
        function avia_custom_query_options($elements)
        {
            $allowed_elements = array('av_blog','av_masonry_entries','av_postslider','av_portfolio','av_magazine');
    
            if(isset($_POST['params']['allowed']) && in_array($_POST['params']['allowed'], $allowed_elements))
            {
                $elements[] = array(
                    "name" => __("Custom Query Orderby",'avia_framework' ),
                    "desc" => __("Set a custom query orderby value",'avia_framework' ),
                    "id"   => "orderby",
                    "type"  => "select",
                    "std"   => "",
                    "subtype" => array(
                        __('Default Order',  'avia_framework' ) =>'',
                        __('Title',  'avia_framework' ) =>'title',
                        __('Random',  'avia_framework' ) =>'rand',
                        __('Date',  'avia_framework' ) =>'date',
                        __('Author',  'avia_framework' ) =>'author',
                        __('Name (Post Slug)',  'avia_framework' ) =>'name',
                        __('Modified',  'avia_framework' ) =>'modified',
                        __('Comment Count',  'avia_framework' ) =>'comment_count',
                        __('Page Order',  'avia_framework' ) =>'menu_order')
                );
                $elements[] = array(
                    "name" => __("Custom Query Order",'avia_framework' ),
                    "desc" => __("Set a custom query order",'avia_framework' ),
                    "id"   => "order",
                    "type"  => "select",
                    "std"   => "",
                    "subtype" => array(
                        __('Default Order',  'avia_framework' ) =>'',
                        __('Ascending Order',  'avia_framework' ) =>'ASC',
                        __('Descending Order',  'avia_framework' ) =>'DESC'));
            }
            return $elements;
        }
    
        add_filter('avf_template_builder_shortcode_meta', 'avia_custom_query_add_query_params_to_config', 10, 4);
        function avia_custom_query_add_query_params_to_config($meta, $atts, $content, $shortcodename)
        {
            global $avia_config;
            if(empty($avia_config['avia_custom_query_options'])) $avia_config['avia_custom_query_options'] = array();
    
            if(!empty($atts['order']))
            {
                $avia_config['avia_custom_query_options']['order'] = $atts['order'];
            }
    
            if(!empty($atts['orderby']))
            {
                $avia_config['avia_custom_query_options']['orderby'] = $atts['orderby'];
            }
            return $meta;
        }
    

    it will add on each ALB which concerns to a sort option dialog.

    #1193376

    Hi,

    Thanks for sharing and for helping out @guenni007 :-)

    Best regards,
    Rikard

    #1193408

    Hello Günni (@guenni007),

    It worked… the plugin did the job. :)

    Have a good week,
    Jables

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Masonry / portolio grid: How can I change the order of sort options (not abc)?’ is closed to new replies.