wordpress convert timestamp to date not correctly
Try this. It works wp_date( ‘Y/m/d – h:i:s’, 1598205923, new DateTimeZone(‘Asia/Tehran’) )
Try this. It works wp_date( ‘Y/m/d – h:i:s’, 1598205923, new DateTimeZone(‘Asia/Tehran’) )
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.
You’ll have to create your own but you can copy the code and customize from /wp-includes/default-widgets.php If you edit the defaults they’ll screw up when you update WP.
You can just use: /2011/08/?taxonomy=term I’m not sure how to create a rewrite rule though to make it “pretty”
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
Your date format is in the wrong order. Think of it from a strictly numerical perspective- 11222012 > 1032013 Dates should follow the MySQL date format in descending units- yyyy-mm-dd
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
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
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
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