Order a query by meta_value and then by post_date
Order a query by meta_value and then by post_date
Order a query by meta_value and then by post_date
The parameter should be orderby rather than order_by. (See codex)
Display “Today” Instead of Date for Pubslished Posts
Your arrays seem malformed : $args[‘date_query’] = array( array( ‘after’ => $datefrom, ‘before’ => $dateto, ‘inclusive’ => true ) ); Also check here and be sure you are passing dates with proper string format !
Maybe you’ld like to go to settings > general and then add a custom date format. Like d.m.1985 instead of d.m.Y Or you write a function that subtracts the time you want from the current date. Or you set the server time back to 1985. But that’s no good idea since it will affect other … Read more
It’s hard to know what aspect of this you are asking for help with, but as a developer I would create it like this: Create a page for each image gallery, perhaps using WordPress’s built in gallery feature Set a featured image on each gallery page Create a set of relationship fields in Advanced Custom … Read more
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’ => $today[“mday”] ); query_posts( $args );
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 sidebar. … Read more
Year based WP Query
Creating a Scheduled Event First we’ll create a function that will schedule our event. Mine is called “mycronjob” and it will run once every day. All this code can go into your plugin’s main file, outside the main function: // create a scheduled event (if it does not exist already) function cronstarter_activation() { if( !wp_next_scheduled( … Read more