Tag Info

New answers tagged

1

You have to use the posts_orderby filter to do this at the mo, eg function wpse159469_posts_orderby( $orderby, $query ) { return implode( ' DESC,', explode( ',', str_replace( array(' ASC', ' DESC' ), '', $orderby ) ) ) . ' DESC'; } then around your query: add_filter( 'posts_orderby', 'wpse159469_posts_orderby', 10, 2 ); $query = new WP_Query( array( ...


0

My other answer was deleted :( don't really get why, tried to edit, but it remained deleted. so here's again. hopefully it stays, as the problem still exists. it doesn't work, well not like I wanted to... because the message shows up on every page, even on the starting part of the blog http://wrestling-talk.de/wordpress I used get_the_date('U') <= ...


0

I assume you would like to do this through the WordPress admin and not edit your sidebar.php so here is a possible solution. First, find out what the timestamp of August 22 was at http://www.epochconverter.com. Based on GMT time I got "1408665600" Install the Widget Logic Plugin: https://wordpress.org/plugins/widget-logic/ Add a widget to your left ...


2

Hacking the core is never recommended, since you'll have to reapply your hack every time you update (and for a number of other reasons). The first thing I would normally do is to check if there is a hook or filter to allow you to modify the date. It doesn't appear there is one. The next thing you might check is whether the function you'd like to change is ...


0

Do the other post have to be set to draft? Or would just showing today's post work? If just showing today's post works you could do something like the following $today = getdate(); $args = array( 'category_name' => 'event', 'posts_per_page' => 5, 'year' => $today["year"], 'monthnum' => $today["mon"], 'day' => ...


0

Use meta_value instead of meta_value_num <?php $course = new wp_query( array ( 'posts_per_page' => '10' , 'post_type' => 'course', 'orderby' => 'meta_value', 'meta_key' => 'course_date', ...


0

Go to Dashboard -> Appearance -> Widgets. You are looking for Archives widget. If your theme has built in sidebar, you'd just select the appropriate widget in that sidebar. To create a new sidebar in your theme, you need to use register_sidebar() in your theme's functions.php. To include a sidebar in your file, you'd use get_sidebar() in your ...


0

As of 3.7 you can use date_query http://codex.wordpress.org/Class_Reference/WP_Query#Date_Parameters So the args passed would look like: $query_string = array( 'post_type' => 'post', 'date_query' => array( 'after' => '2012-04-01' ), 'tax_query' => array( array( 'taxonomy' => ...



Top 50 recent answers are included