Automatically republish old posts

http://wordpress.org/extend/plugins/oldest-2-newest-redux/ it takes your oldest post and reposts it in the front every 24 hours, but you can change the hours on the php file in the plugin folder not sure if this is what u are looking for.

XML-RPC and post_date

There are a couple of issues here. First of all, wp.editPost takes a fourth parameter before the content struct -> the ID of the post you’re trying to edit (should be an integer). Second, you’re passing a string for the post_date, so the client automatically converts this to a <string> tag before sending it to … Read more

Arrange posts by date in front page

Add orderby and order to your arguments: $cat_query = new WP_Query( array( ‘post__not_in’ => get_option( ‘sticky_posts’ ), ‘category__in’ => array($cat->term_id), ‘posts_per_page’ => 5, ‘paged’ => $paged, ‘orderby’ => ‘date’, ‘order’ => ‘DESC’ ) ); Update it seems it still takes one category, lists 5 posts and then goes to another, with 5 posts etc. It … Read more

Get random posts between specific dates / of specific age

Two notes beforehand: There is no (unless you created a CPT) post type random_posts. Don’t use query_posts. That being said, the following will do what you want: Just the randomness $args = array( ‘posts_per_page’ => ’10’, ‘orderby’ => ‘rand’ ); $random_posts = get_posts( $args ); foreach( $random_posts as $random_post ) { // do something echo … Read more

How to get date using timezone saved in options? [duplicate]

I use this: $mytheme_timezone = get_option(‘timezone_string’); date_default_timezone_set($mytheme_timezone); in my themes functions.php. For me this has worked without any warnings. I’ve also tested whether my script is in different timezone than php.ini: if (strcmp($mytheme_timezone, ini_get(‘date.timezone’))){ echo ‘Script timezone differs from ini-set timezone.’; } else { echo ‘Script timezone and ini-set timezone match.’; } Please improve this … Read more

Advanced custom fields: Customise date picker’s start date (need to choose year 1500 onwards) [closed]

You can do this by customizing the plugin. You’ll want to find timepicker.js in /wp-content/plugins/acf-field-date-time-picker/js/timepicker.js And change line 21: , yearRange: “-100:+100” to your preferred range, for example: , yearRange: “-500:+100” This gives you a dropdown that, by default, goes back 500 years and forth 100, from the current year. Or you can hardcode a … Read more