In wordpress, right now only on my main blog page, I managed to sort all posts with:
<?php if ( is_active_sidebar( 'blog-category' ) ) : ?>
<?php dynamic_sidebar( 'blog-category' ); ?>
<?php endif; ?>
</div>
<div class="blog_list_content">
<?php
global $wp_query;
$args = array(
'meta_key' => 'publish_date',
'orderby' => 'meta_value',
'order' => 'DESC'
);
$args = array_merge( $wp_query->query, $args );
query_posts( $args );
if (have_posts()) :
while (have_posts()) : the_post();
get_template_part( 'template-parts/content', get_post_format() );
endwhile;
theme_paging_nav();
endif;
?>
When I click a blog category, the sorting doesn't work. Only on the main blog page. What do I need to do in order to sort the posts on other categories in the same way?