Custom Post Type Pagination & duplicate posts

I think the best way to implement this is to use pre_get_posts hook. Take a look at this code function customize_query( $query ) { $post = get_posts(array( ‘post_type’ => ‘projects’, ‘taxonomy’ => ‘featured’, ‘numberposts’ => 1 )); if ( $query->is_home() && $query->is_main_query() ) { $query->set( ‘post_type’, ‘projects’ ); $query->set( ‘posts_per_page’, 6 ); if($post && !empty($post)) … Read more

wp_query to display custom taxonomy terms

For a custom taxonomy query add the ‘tax_query’ => array() $args = array( ‘post_type’ => ‘featured_job’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => 9999999, ‘orderby’ => ‘date’, ‘order’ => ‘DES’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘job_category’, // custom taxonomy ‘field’ => ‘slug’, ‘terms’ => ‘business’, // taxonomy term (category) ), ), );

Include a specific post to the query_posts and remove it if it is already in the returned list

Okay so I tried to read your code, and failed, and reformatted it as it’s currently unreadable, and any errors are obscured by this unreadability. I cannot stress the importance of indenting correctly and following a standardised formatting for making your life infinitely easier: <?php $featured_class=”et_cycle”; $tag = ‘ul’; $attr=”class”; if($responsive){ $featured_class=”flexslider” . $featured_auto_class; $tag … Read more

How to List Thumbnails based on Custom Categories

You need to use custom post and make the categorys there and align the thumbnails in each post. <?php // query post type */*/ global $post; $args = array( ‘post_type’ => ‘YOUR-POST-TYPE-HERE’, ‘cat’ => $category, ‘suppress_filters’ => ‘0’, ‘numberposts’ =>’-1′, ‘orderby’ => ‘title’, ‘order’ => ‘asc’, ‘post_status’ => ‘publish’ ); $myposts = get_posts( $args ); … Read more

How to output content based on same custom taxonomy?

we meet here again 🙂 Try using this: $term_list = wp_get_post_terms( $post->ID, ‘persons’, array( ‘fields’ => ‘ids’ ) ); and ‘tax_query’ => array( array( ‘taxonomy’ => ‘persons’, ‘field’ => ‘id’, ‘terms’ => $term_list ) ), AFAIK, the tax_query accepts field by id or slug only (see here. And the wp_get_post_terms accepts only names (not slug), … Read more