Page permalink conflict with Date

First of all rewrite handling can become very complicated very quickly – particularly when your desired structure conflicts with WordPress’ default behaviour. The best advice is probably to just avoid such conflicts rather than try to resolve them. With that as a premable… WordPress generates rewrite rules from various sources: from registered post types, rules … Read more

Metabox date month number to word

The code you are using is specifically for the month abbreviation, (Oct). You should be using this: function eventposttype_get_the_month($month) { global $wp_locale; for ( $i = 1; $i < 13; $i = $i +1 ) { if ( $i == $month ) $month =$wp_locale->get_month( $i ) ; } return $monthabbr; }

Preventing 404 error on empty date archive

You can move the code from OP’s answer into a 404 template filter and force WP to load the date.php file instead of 404.php. It’ll still send the 404 header, but render the page with a different template. function wpd_date_404_template( $template=”” ){ global $wp_query; if( isset($wp_query->query[‘year’]) || isset($wp_query->query[‘monthnum’]) || isset($wp_query->query[‘day’]) ){ $template = locate_template( ‘date.php’, … Read more

Get date of last update outside of loop

It is unclear if you are looking for the last updated post or for the last updated date for some particular post. The answer by @PatJ assumes the former. To do the latter: $qry = new WP_Query(array(‘p’=>1)); var_dump($qry->posts[0]->post_modified); Or… $date = $wpdb->get_var(“SELECT post_modified FROM {$wpdb->posts} WHERE ID = 1”); var_dump($date); Of course you need to … Read more

WordPress Posts By Date/Day?

Not a bad idea for display of a blog home page and I would be interested in what you came up with, but thinking through the idea for implementation beyond the first page would be problematic: Pagination – If it is just the blog home then you can easily set an offset for starting on … Read more

Get Recent Posts by Date in Multisite

Since wordpress multisite uses different tables for all blogs, it is very inefficient to get all recent articles of all blogs (content aggregation) on display time since you have to query all blogs, sort the articles by date and display the ammount you need. Plugins like WordPress Post Indexer (https://premium.wpmudev.org/project/post-indexer) additional write all posts into … Read more

Permitting WordPress to accept dates outside of 1902-2038

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 … Read more

using wp_update_post on save_post

The reason it’s going to be infinite is that every time you save the post, it’s calling change_year…which then calls wp_update_post … which fires the save_post filter. After some review and research, I’m thinking that you should probably avoid the save_post filter. Try using this filter: http://codex.wordpress.org/Plugin_API/Filter_Reference/wp_insert_post_data It gives you really what you want. Here’s … Read more

Display a post’s publish date from 2112

I had the same issue as you when I was dealing with events and wanted to show future events. Here is what I coded: add_action( ‘init’, ‘change_future_posts_to_post_now’ ); function change_future_posts_to_post_now() { remove_action(“future_post”, ‘_future_post_hook’); add_action(“future_post”, ‘publish_future_posts_now’, 2, 10); } function publish_future_posts_now($depreciated, $post) { wp_publish_post($post); } add_filter(‘posts_where’, ‘show_future_posts_where’, 2, 10); function show_future_posts_where($where, $that) { global $wpdb; if(“post” … Read more