How do I create filters for custom post types?

This is how I did it. If you have your custom post type as “projects”, and your category as “airplane”. If you’re not planning on using the pre-build loop you would make another one called loop-projects.php. However, it’s not necessary. <?php $args = array( ‘numberposts’ => 5, ‘post_type’ => ‘projects’, ‘category_name’ => ‘airplane’); query_posts( $args … Read more

Archives for Custom Post Types (without Pages)

replace: return str_replace( “post_type=”post”” , “post_type IN ( $post_types )” , $where ); with: return str_replace( “post_type=”post”” , “post_type=”YOUR_CUSTOM_TYPE”” , $where ); and change YOUR_CUSTOM_TYPE to your actual custom post type name. Update: If you want all types but pages then change your function abit to this: add_filter( ‘getarchives_where’ , ‘ucc_getarchives_where_filter’ , 10 , 2 … Read more