Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1044264

    Hello Support team ,

    Need your help in sorting the portfolio items manually with portfolio grid .
    currently I’m using plugin port sorter which is 4 years old & doesnt support latest php version results in error while editing the post .
    With this plugin i can assign the numbers to the portfolio items , which will display as we set under portfolio grid .

    is there any way we can sort the items on portfolio grid with custom mechanism as we desire with any custom code or any latest plugin ?

    if you see our website under FEATURED PRODUCTS the items listed are portfolio items . it’s a portfoilio grid .

    #1044394

    Well i do not see your page – must be a link in private area – but there are some snippets to have on each Gallery or Masonry Blog an input to have the choice how it is sorted:

    this comes to child-theme functions.php

    if(!function_exists('avia_custom_query_extension'))
    {
        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;
        }
    }

    If you like to have it sorted manually – you can sort it on dashboard – portfolio items – list view by drag and drop through this old but working plugin:
    https://wordpress.org/plugins/intuitive-custom-post-order/

    #1044400
    #1044704

    Hi,

    Thanks for helping out and sharing @guenni007, did you try that out and did you have any luck with it @idvisionme?

    Best regards,
    Rikard

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