Listing Custom Post Post from certain category

This can be achieved with Multiple Taxonomy Handling. Try this code. <?php $args = array( ‘post_type’ => ‘note’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘category’, ‘terms’ => array( ‘class 11’, ‘chemistry’ ), // Add suitable term slugs here ‘field’ => ‘slug’ ) ) ); $my_query = new WP_Query( $args ); if( $my_query->have_posts() ) { while … Read more

How to remove UI access to Custom Post Type using direct links?

Yes. Use capabilities! When registering a post type, take a look at the capability_type and capabilities. You can define a custom capability map for the standard edit_post, delete_post, etc. for your post type. The thing you remember is, if you customize the capabilities, YOU DON’T HAVE THESE CAPABILITIES EITHER! This means you’ll have to get … Read more

Custom Fields as Post Type Options

Your code… function wpuf_update_vehicle_year( $post_id ) { $year = get_post_meta( $post_id, ‘seek_property_year’, true ); update_post_meta( $post_id, ‘seek_property_year’, $year ); } add_action( ‘wpuf_add_post_after_insert’, ‘wpuf_update_vehicle_year’ ); is probably executed, but nothing will change anyway because the thing it does is to grab meta data (with get_post_meta) for seek_property_year and then update the same meta data with the … Read more

Optimise custom post type queries

It’s not clear if you mean 800ms for total page load with assets and network overhead (which is quite good) or for page generation time alone (much less good). In any case you are making a large mistake of guessing that query is your performance bottleneck. That’s not how performance optimization works. You need to … Read more