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

    Hi

    I have used posts to create many of the sites pages to allow the side arrows to display and also click through to the next page (post). The date order of these is correct for these click throughs.

    On the home page as well as over view pages I have the blog displayed as a gird – on these the order displays reversed. Is there any way to have these reversed without affecting the post order. So essentially would just be to blog grid elements?

    Thanks M

    #1395746

    Hey Matt,
    Thanks for the link to your page, for the first grid block I see “lesson 41” is at the top, I assume that you want “lesson 1” at the top.
    Try this css:

    @media only screen and (min-width: 768px) {
    .avia-content-slider.avia-content-grid-active .avia-content-slider-inner  {
        display: flex;
        flex-direction: column-reverse;
    }
    }

    After applying the css, please clear your browser cache and check.

    Best regards,
    Mike

    #1395752

    Hi – thanks for that
    Yes – on these 3 pages the blog grid should reverse so starts at Lesson 1
    This won’t work as it needs to be reversed on all screen sizes.

    Would be great to be able to change the blog order to acceding/descending by date.

    Thanks M

    #1395754

    AH wait – cache finally cleared – actually worked after a small change to the CSS – however small issue
    The last few which were on their own before now are on the top alone – so have a weird space to right of top row.

    #1395761

    Hi,
    That is because there is only one item in that row, we can’t change that you would need to change the rows.
    When it was at the bottom it was also alone.

    Best regards,
    Mike

    #1395795

    Hi – Not just that – its running top to bottom correctly – but its running right to left.

    Is there anyway to get this running so top line has a full row and is running left to right?

    Thanks M

    #1395799

    Hi,
    Please remove the above css so we can try again.

    Best regards,
    Mike

    #1395841

    Have removed.

    #1395842

    Hi,
    Try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:

    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;
    }

    This should add a new sorting field to your blog element, try choosing Ascending Order:
    Enfold_Support_252.jpeg
    In my test before adding this my blog element grid put 1 at the bottom and 9 at the top
    Enfold_Support_250.jpeg
    When I set the new option to Ascending Order it reversed the order:
    Enfold_Support_254.jpeg

    Best regards,
    Mike

    #1395881

    That worked brilliantly – thank you.

    #1395882

    Don’t suppose on the same deal its possible to get 6 row columns?

    #1395885

    Hi,
    It looks like we both wrote at the same time, so I reopened the thread. We don’t have a way to make the blog element show 6 columns, if you want to manually create 6 columns you can follow our documentation: Six Columns or more.
    Unless there is anything else we can assist with on this issue, shall we close this then?

    Best regards,
    Mike

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Reversing the order of specific blog posts’ is closed to new replies.