WordPress archives by custom field and date

This will get the posts filtered by custom field and its value based on categories. $args = array( ‘post_type’=>’post’, ‘category__in’=> array(6, 7, 31), //category id ‘meta_key’=>’keys’, // customfield name ‘meta_value’=>5, // customfield value ‘posts_per_page’=>-1, ‘number_posts’=>-1 ); $s = get_posts($args); foreach($s as $e ) { echo $e->ID.'<br/>’; echo $e->post_title.'<br/>’; }

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)