How do I echo the post type?

Well, as far as I can tell you’ve got a syntax error there. Try this: <?php $post_type = get_post_type( $post->ID ); if ($post_type == ‘project’) echo ‘Work’; ?> Also, make sure to check out what eileen.carpenter said in the comment to your question.

pre get posts changing the query

Try using meta_query parameter : add_action(‘pre_get_posts’, ‘add_event_date_criteria’); function add_event_date_criteria(&$query) { // We only want to filter on “public” pages // You can add other selections, like here: // – Only on a term page for our custom taxonomy if (!is_admin() && is_tax(‘event-tag’) || is_tax(‘event-category’)) { $time = time(); $meta = array( array( ‘key’ => ‘start_time’, … Read more

Thumbnails on next/previous links in custom post type single.php

The first argument that get_previous_post and get_next_post is $in_same_cat. WordPress is looking for post of the same type in the current posts category. If your custom post type doesn’t support the category taxonomy, both functions are likely to return nothing for the previous and next post. Try calling both functions without arguments for your custom … Read more

Customized first post techniques

You shouldn’t need to do any special queries for this. Here is one way to accomplish it /** * conditional check ensures special class only shows on top post on first page. * if you want top post on page 2, etc. to have special class, just set $first_post to true */ if( (int) get_query_var( … Read more

Disable All In One SEO Pack for some custom post types [closed]

If you’re satisfied with disabling the SEO-Pack on all CPTs, go with brasoflo’s answer. Should you want to keep the metabox for some CPTs and disable it only for a select few: function wpse_55088_remove_aiosp() { remove_meta_box( ‘aiosp’, ‘movie’, ‘advanced’ ); } add_action( ‘add_meta_boxes’, ‘wpse_55088_remove_aiosp’ ); Where ‘movie’ is, going with brasoflo’s answer, the name of … Read more

Creating a function that receives the taxonomy terms that have been changed in a custom post type

After WordPress has updated a posts’ taxonomy terms it triggers the action: set_object_terms (see source) which passes 6 variables: Object ID Terms that were assigned to the post (or added depending on 5) (could be their slug or term ID). Taxonomy-term IDs of above (not term IDs) The taxonomy Append. If true – terms in … Read more