Show previous month’s posts

This could be a simple PHP issue of how you are asking to return the first date() date(‘M’, mktime(0, 0, 0, date(‘m’), 0, date(‘Y’))); is returning Dec, and WP_Query needs the month number. First, try changing ‘M’ to ‘m’. date(‘m’, mktime(0, 0, 0, date(‘m’), 0, date(‘Y’))); If that doesn’t work, try using the date_query and … Read more

How can I list custom post by custom category?

Using categories isn’t the same as using a custom taxonomy. You should adapt your code to use get_terms and to query for your custom tax: $categories = get_terms(‘article’); foreach($categories as $category) { $args=array( ‘article’=>$category->slug, ‘post_type’ => ‘journal’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => -1, ‘caller_get_posts’=> 1); }

Custom post type blog pagination conflict

Thank you to Milo for pointing me to the pre_get_posts hook. That was exactly what I needed. Here is my updated code: Archive page code <?php get_header(); get_template_part( ‘include/content’, ‘head’ ); ?> <div class=”postcontent nobottommargin<?php if( semi_option( ‘blog_sidebar’ ) == ‘left’ ) { echo ‘ col_last’; } ?> clearfix”> <?php if ( have_posts() ) : … Read more

Custom Query With Multiple Meta Key Value

Try this: <?php $querydetails = ” SELECT wposts.* FROM $wpdb->posts wposts INNER JOIN ( SELECT post_id FROM $wpdb->postmeta wpostmeta WHERE ( ( wpostmeta.meta_key = ‘type’ AND wpostmeta.meta_value LIKE ‘%Collection1%’ ) OR ( wpostmeta.meta_key = ‘type’AND wpostmeta.meta_value LIKE ‘%Collection2%’ ) OR ( wpostmeta.meta_key = ‘type’AND wpostmeta.meta_value LIKE ‘%Collection3%’ ) OR ( wpostmeta.meta_key = ‘type’AND wpostmeta.meta_value LIKE … Read more

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