Custom taxonomy query showing more than 4 posts

This is why code indentation is so important! Your posts_per_page argument is actually part of your tax_query: ‘post_type’ => ‘regularproducts’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘products-category’, ‘field’ => ‘slug’, ‘terms’ => $course_terms, //the taxonomy terms I’d like to dynamically query ‘posts_per_page’ => ‘4’ ), ), ‘orderby’ => ‘title’, Instead, you should have: $wp_query = … Read more

CPT, meta-data, url parameter

The good answer was from @Milo, but he haven’t posted any code, so I post here my result, for people coming here for the right answer. /* Add query var to authorized query var… */ add_filter( ‘query_vars’, ‘add_spectacles_query_vars’ ); function add_spectacles_query_vars( $query_vars ) { $query_vars[] = ‘spectacles-year’; $query_vars[] = ‘spectacles-month’; $query_vars[] = ‘spectacles-day’; return $query_vars; … Read more

Display all images from specific CPT

You are on the right track here, but it is a bit bumpy Firstly, caller_get_posts is depreciated, that has been replaced with ignore_sticky_posts Secondly, you should use wp_reset_postdata not wp_reset_query. The latter is used in conjuction with query_posts which should never be used. Thirdly, your call to images should be inside your loop, not outside. … Read more

next page with custom post

I think the problem is that the previous_posts_link() and next_posts_link() are using the global $wp_query object. Try changing your code to something like this: // save the original $wp_query object $temp = $wp_query; // create a new $wp_query object $wp_query = new WP_Query($args); while($wp_query->have_posts()): $wp_query->the_post(); // output your data here endwhile; // display previous and … Read more

is it possible in a custom post, create custom fields as well whitin?

I think you’re looking for add_meta_box http://codex.wordpress.org/Function_Reference/add_meta_box // Metabox actions add_action( ‘add_meta_boxes’, ‘metabox_create’ ); // create add_action( ‘save_post’, ‘metabox_save’ ); // save // Create metabox function metabox_create() { add_meta_box( ‘metabox_name’, ‘Metabox Title’, ‘metabox_content’, ‘my_custom_post_type’, ‘normal’, ‘high’ ); } // metabox content function metabox_content() { global $post; // custom field data $custom = get_post_custom( $post->ID ); … Read more