Setting posts per page in query_posts

Here’s what I usually use the pre_get_posts action to change a single query value for a taxonomy or category page: /** * Control the number of search results */ function custom_posts_per_page( $query ) { if ( $query->is_tax(‘mytaxonomy’) || $query->is_category(‘mycategory’) ) { set_query_var(‘posts_per_page’, 9); } } add_action( ‘pre_get_posts’, ‘custom_posts_per_page’ );

How do I create a form to search a custom post type

just add <input type=”hidden” name=”post_type” value=”post type name” /> to your search form and obviously replace post type name with your custom post type name. and to make sure that only your custom post type return as results add: function mySearchFilter_0987($query) { $post_type = $_GET[‘post_type’]; if (!$post_type) { $post_type=”any”; } if ($query->is_search) { $query->set(‘post_type’, $post_type); … Read more

Custom Post Type and Labels

you can use: add_filter(‘gettext’,’custom_author_lable’); function custom_author_lable( $input ) { global $post_type; if( is_admin() && ‘your_post_type’ == $post_type ) if (‘Author’ == $input || ‘author’ == $input) return ‘Keynote Speaker’; return $input; } just replace your_post_type.