date issue with category post retrival

Ok I finally found the answer. The issue was caused by a strange enclosures from the podcasting plugin. Removed the enclosure and BAM everything is fine now! The main think to notice: if you have such a problem, your feed is probably invalid. Validate your feed first and then see if there are any problems … Read more

Escaping date string in url with wordpress

strtotime will return false if you give it weird information. echo strtotime(“<script>’); // bool(false) However, if you do what you are doing and nest two statement you may not get what you expect. echo strtotime(‘+1 day’,strtotime(‘<script>’)); // int(86400) And date returns the beginning of the universe, the day of creation– January 1, 1970– if given … Read more

How to order posts of a custom post type by date DESC in dashboard Admin?

Alright, You can just hook into the filter pre_get_posts and check is_admin. Put this in your theme or plugin: function wpse_81939_post_types_admin_order( $wp_query ) { if (is_admin()) { // Get the post type from the query $post_type = $wp_query->query[‘post_type’]; if ( $post_type == ‘Videos’) { $wp_query->set(‘orderby’, ‘date’); $wp_query->set(‘order’, ‘DESC’); } } } add_filter(‘pre_get_posts’, ‘wpse_81939_post_types_admin_order’); I also … Read more

Shortcode for latest -not expired- posts

Thanks, i got it now; indeed with meta_query. function my_recent_posts_shortcode( $atts ) { global $post; $currenttime = current_time(“mysql”); $args = array( ‘post_type’ => ‘post’, ‘meta_query’ => array( array( ‘key’ => ‘newsbox-date’, ‘value’ => $currenttime, ‘compare’ => ‘>’ ) ) ); $newsbox = new WP_Query( $args ); if ( $newsbox->have_posts() ) : $list=”<div class=”newsbox-posts”>”; while ( … Read more

Taxonomy and Date in same query?

Take a closer look at the date parameters; you’ll need to enter an integer (number), not a string (text). Simply get rid of the single quotes to make it work: $args = array( ‘post_type’ => ‘job’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘location’, ‘terms’ => ‘dallas’, ‘field’ => ‘slug’ ) ), ‘date_query’ => array( array( … Read more