Sorry, I think we closed this thread: https://kriesi.at/support/topic/bug-report-blog-posts-element
a bit too fast. I dug a bit deeper and found the problem.
I am using the “blog posts” element from the builder. I don’t want the blog posts displayed by date. So I used the Snipped you provided: http://kriesi.at/documentation/enfold/change-the-sort-order-of-blog-posts-elements/
And added this code to my functions.php:
//blog post order -> menu order
add_filter('avia_blog_post_query', 'avia_modify_post_grid_query_rand');
function avia_modify_post_grid_query_rand( $query ) {
$query['orderby'] = 'menu_order';
$query['order'] = 'ASC';
return $query;
}
As soon as I do this, the Layout breaks. If i remove the snippet, everything works fine. Any idea why this is happening?
—
PHP (7.3.27)
Enfold (4.8.3)
Wordpress (5.7.2)
Hey,
Thanks for contacting us!
I tested it on my local installation and it works as expected on my end. Have you enabled page attributes on posts? If not, please add following code to functions.php file of your child theme as well
add_action( 'admin_init', 'av_post_custom_order' );
function av_post_custom_order()
{
add_post_type_support( 'post', 'page-attributes' );
}
Best regards,
Yigit
I found the problem. It was something completely different. There was a button shortcode in one of my blogposts. So when this particular post was displayed it broke the layout.
Is this a known bug?