Category: PHP
Add following snippet to your themes functions.php
add_filter('show_admin_bar', '__return_false');
Display posts dates as 2 days ago
instead of regular date.
$the_query = new WP_Query( array(...) );
$posts = $the_query->get_posts();
In WordPress 4.0+ WP_Query
argument orderby
accepts arrays, so posts can be ordered by multiple keys and orders.
In example