-
AuthorPosts
-
November 13, 2014 at 4:32 pm #350701
Hi,
I’m using Advanced Post Types Order (APTO) and I faced a problem to reorder the posts in each category.
(my website: http://www.homelink.fr/wp/le-blog/)
I ask to Nsp Code support some help. They had many difficulties to find the problem and they finally told me, it was an Enfold bug.Here are what they told me:
Checked further into this, it appear the problem is caused by the theme code, re-query the main arguments along with modifications. So practically even if the plugin correctly return the order, the theme does not takes that in consideration. It supposed to use ‘orderby’ = ‘post__in’ to preserver any order indexes for the new re-query.
Anyway you can get in touch with the author for a fix, or simply use the following filter :add_filter(‘avia_post_slide_query’, ‘theme_avia_post_slide_query’, 99, 2);
function theme_avia_post_slide_query($query, $params)
{
if(is_home())
{
//blog}
if(is_archive())
{
$query[‘orderby’] = ‘post__in’;
$query[‘force_no_custom_order’] = TRUE ;}
return $query;
}
You should include this in your child theme functions.php or a custom plugin.I did it and it works.
Hope this info may interest you to include this fix in the theme.Best,
DavidNovember 14, 2014 at 6:24 pm #351414Hi David!
thank you very much for the info. I will forward it to Kriesi.
Regards,
AndyJune 9, 2017 at 12:55 am #805794I also sort my blog posts in the backend manually with the plugin Advance Post Types Order. When it comes to the output of the content element “blog posts”, this works as well. But it does not work with content element “magazine”. I included the filter in functions.php of my enfold child theme, but it did not work in the “magazine”. How can i adjust the filter? Or the filter does not work in “magazine”?
How can I output the posts in the “magazine” in the same order as the “blog posts”?Best Regards,
MargitJune 12, 2017 at 8:25 pm #807060Hi Margit,
You can use this filter for the magazine “avf_magazine_entries_query” and try to do the same.
If you need further assistance please let us know.
Best regards,
VictoriaJune 12, 2017 at 9:16 pm #807077i don’t know what this plugin does.
If i like to have the chance to choose the orderby option on galleries and masonries i put in functions.php of the child theme the following snippet:
http://kriesi.at/documentation/enfold/how-to-add-an-orderorderby-option-to-the-blogpost-sliderportfoliomasonry-grid-element/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; } }
June 12, 2017 at 9:18 pm #807080June 13, 2017 at 5:16 am #807218Hi,
Thank you for the input, Guenni!
Margit, please let us know if you need help after trying Victoria and Guenni’s suggestions.
Best regards,
SarahJune 24, 2017 at 6:37 pm #812480Thank you for your many answers. Unfortunately I could not react, I was on holiday. The “Advanded PostTypes Order” plugin allows you to manually sort posts by drag and drop. This function was required on the start page. I wanted to show 2 main categories in the magazine and sort these posts manually if needed. This don’t work with the plugin and also don’t work with the filter scripts. The problem I have now solved differently. I have the categories displayed in separate magazines. Within these categories I sort the posts now by changing the date of the posts. This is cumbersome, but I find no other solution.
June 24, 2017 at 9:13 pm #812520Hi,
Thank you for sharing your solution, I couldn’t find any other solution. Shall we will close this now? Thank you for using Enfold.Best regards,
MikeJune 24, 2017 at 9:15 pm #812523Yes, you can Close this.
Best regards
MargitJune 24, 2017 at 9:41 pm #812532 -
AuthorPosts
- The topic ‘A bug with Advanced Post Types Order’ is closed to new replies.