Posted date format not reflected

I found a workaround by myself. In wp-content/themes/twentythirteen/function.php: function twentythirteen_entry_date( $echo = true ) { : //$date = sprintf( ‘<span class=”date”><a href=”https://wordpress.stackexchange.com/questions/112514/%1$s” title=”%2$s” rel=”bookmark”><time class=”entry-date” datetime=”%3$s”>%4$s</time></a></span>’, $date = sprintf( ‘<span class=”date”><a href=”https://wordpress.stackexchange.com/questions/112514/%1$s” title=”%2$s” rel=”bookmark”><time class=”entry-date” datetime=”%3$s”>%3$s</time></a></span>’, x %4$s o %3$s Still, it doesn’t seem to reflect the choice of the date-format setting made on wp.

Query Posts by date range with fixed beginning and end

You should probably add the filter, then use a new query, then remove the filter. function filter_where( $where ) { $where .= ” AND post_date >= ‘2012-03-01’ AND post_date <= ‘2014-03-01′”; return $where; } add_filter( ‘posts_where’, ‘filter_where’ ); $query = new WP_Query( array( ‘post_type’ => ‘shop_order’ ) ); while( $query->have_posts() ) : $query->the_post(); the_title(); the_content(); … Read more

Set Custom Date for Posts

Yes you can put custom date by editing the published on date on the top right of the post/page edit. See the image attached for better understanding.

Display metabox with date

In database, it stores the date details with prefix as _start and _end so you need to change the meta keys accordingly. Please have a look at the below code. <p>Start time details</p> <p>Date: <?php echo get_post_meta($post->ID, ‘_start_day’, true);?>.<?php echo get_post_meta($post->ID, ‘_start_month’, true);?>.<?php echo get_post_meta($post->ID, ‘_start_year’, true);?></p> <p>Hour: <?php echo get_post_meta($post->ID, ‘_start_hour’, true);?>:<?php echo get_post_meta($post->ID, … Read more

How to second orderby in “pre_get_posts” by meta value or combine single date and time to timestamp

I’m outlining a solution for what you asked in your last comment, because this wouldn’t been fitting for the comment format. Code: function date_time_to_timestamp_meta( $post_id ) { // meta fields are saved in DATETIME, e.g. »2013-12-09 22:32:12« // here is only the date part relevant $datetime_date = get_post_meta( $post_id, ‘_start_date’, true ); // here is … Read more

How to hide the year in archive link

You could use a regexp to remove the year, though it’s a little hacky: $string = wp_get_archives(‘type=monthly&limit=20&echo=0’); $pattern = ‘ ((19|20)\d{2}(</a>))’; echo preg_replace($pattern, ‘\\3’, $string); Answer from this stackoverflow question: https://stackoverflow.com/questions/5759720/have-wp-get-archives-return-a-string-with-no-year-in-it

date.php shows only three posts’ title. how to fix it?

Use the pre_get_posts action to modify number of posts per page on date archives. This would go in your theme’s functions.php file: function wpa_date_posts_per_page( $query ) { if ( !is_admin() && $query->is_date() && $query->is_main_query() ) { $query->set( ‘posts_per_page’, -1 ); } } add_action( ‘pre_get_posts’, ‘wpa_date_posts_per_page’ );