-
AuthorPosts
-
January 27, 2023 at 2:13 pm #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
January 28, 2023 at 6:35 pm #1395746Hey 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,
MikeJanuary 28, 2023 at 7:20 pm #1395752Hi – 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
January 28, 2023 at 7:29 pm #1395754AH 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.January 28, 2023 at 8:44 pm #1395761Hi,
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,
MikeJanuary 29, 2023 at 11:07 am #1395795Hi – 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
January 29, 2023 at 12:54 pm #1395799January 29, 2023 at 7:27 pm #1395841Have removed.
January 29, 2023 at 8:16 pm #1395842Hi,
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:
In my test before adding this my blog element grid put 1 at the bottom and 9 at the top
When I set the new option to Ascending Order it reversed the order:
Best regards,
MikeJanuary 30, 2023 at 11:50 am #1395881That worked brilliantly – thank you.
January 30, 2023 at 11:53 am #1395882Don’t suppose on the same deal its possible to get 6 row columns?
January 30, 2023 at 11:55 am #1395885Hi,
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 -
AuthorPosts
- The topic ‘Reversing the order of specific blog posts’ is closed to new replies.