Standard API for rendering a date form

Could this work for you? <link type=”text/css” href=”http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/themes/base/jquery-ui.css” rel=”stylesheet” /> <script type=”text/javascript” src=”http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js”></script> <script type=”text/javascript” src=”https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/jquery-ui.min.js”></script> <script type=”text/javascript”> $(document).ready(function(){ $(“#datepicker”).datepicker({ onSelect: function(dateText, inst) { $(“#thedate”).val(dateText); } }); }); </script> <table> <tr> <td style=”vertical-align:top;”> <h3>End Date</h3> </td> <td> <ul> <li><p>(Pick a date from the calendar below)</p></li> <li> <div style=”margin-bottom:5px;” type=”text” id=”datepicker”></div> </li> <li> Date Selected: <input … Read more

Show monthly or daily archives

Before WordPress 4.1, you can show the date archive page titles with the following code: (Taken and slightly modified from the twentyfourteen theme) if ( is_day() ) { printf( __( ‘Daily Archives: %s’, ‘twentyfourteen’ ), get_the_date() ); } elseif ( is_month() ) { printf( __( ‘Monthly Archives: %s’, ‘twentyfourteen’ ), get_the_date( _x( ‘F Y’, ‘monthly … Read more

Get system timestamp in wordpress

You can use PHP’s date() function here, but usually first you’ll need to run date_default_timezone_set. UTC+1 looks like Central Europe time from what I can tell, so here’s what I’d run: <?php date_default_timezone_set(‘Europe/Berlin’); echo date( ‘D, d M Y H:i:s’, now() ); ?> That will print out the current time from your server. If you’re … Read more

Adding a class to last post in the_date

Its possible, you can get the next post date to compare using get_adjacent_post function change your code to this: <?php while ( have_posts() ) : the_post(); //hold current date $curent_date = $post->post_date; //fix the format to YYYY-MM-DD $curent_date = substr($curent_date,0,strpos($curent_date,” “)); $next_post = get_adjacent_post(false,”,false) ; if (!$next_post == ”){ //get next post’s date $next_date = … Read more

Query sub subpages based on specific date?

If you’re loading additional posts/pages, it’s better to use a new WP_Query instance. query_posts is only for modifying the main query. As for the dates, store them in a custom field in the format yyyy-mm-dd. You’ll use php’s date to get the current date, refer to WP_Query’s custom field parameters for how to query and … Read more

Setting Event to Expire Using Custom Metabox

Have a look at the Post Expirator plugin. The Post Expirator plugin allows the user to set expiration dates for both posts and pages. There is a configuration option page in the plugins area that will allow you to seperataly control whether or not posts/pages are either deleted or changed to draft status.