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.
Related Posts:
- Load a script just to custom post type in admin
- How to hook into the CPT’s title placeholder?
- How to set a fall back template for a custom post type in a plugin?
- Post formats “audio” and “video” only showing in index.php
- how do I group content in magazine-style ‘issues’?
- Use standard WordPress categories with a CPT
- Semantic URL Custom Post Type and Taxonomies permalinks
- Pagination with custom loop
- Set post to draft after set period based on post_modified date
- WordPress custom post action hook
- Display metabox conditionally
- How to remove thumbnail sizes for specific post type on a child theme?
- Do attachments added to custom post types have a post parent?
- Get slug to point to different content of the same post
- Custom post type taxonomy template
- Re-order posts in query after
- Hiding Metabox from Screen Options Pull Down
- WordPress Rest API only returns content when posttype has editor capability
- No checkbox in wordpress posts list table for CPT
- Custom Post Type relationship with hierarchical parent and child permalinks
- Category page only displaying the posts from a custom type
- Custom post types, taxonomies, and permalinks
- Help Structuring Query for Archive Pages
- Custom Post Type vs. User Page
- How to rewrite custom post type with custom taxonomy urls?
- Hierarchical Custom Posts – Highlighting Current Post in Sub-Menu
- Display all custom post type posts and order them by an optional meta_key
- need advice on how to do a lists using custom post types – taxonomy vs postmeta
- Selecting New & Edit Page for Custom Post Types
- How to structure a site with product variations pages?
- check if post title in a custom post type exists in page
- How to get updated data when save_post triggers?
- Displaying custom taxonomy in the admin list of a custom post type
- How to change custom post type permalink structure
- Second Set of Eyes: One custom taxonomy shows in Appearance > Menus, one does not
- Hiding posts by other users and non-logged in
- Several CPT’s with same Taxonomy name but with different Terms for each
- Order Custom Post Type by Custom Field Value
- How do I check if the user is on a taxonomy term parent, child or grandchild page?
- Get the taxonomy of a post hierarchically
- Query posts based on the meta key values of logged-in users?
- Hierarchical custom fields
- Specifying Mouseover Icon for Custom Post
- Sizing textarea field in custom metabox
- 4 column-loop ordered alphabetically with entries grouped (and labeled) by their first letter
- Is there something like has_no_term
- what custom post type this archive belongs to?
- Custom post-type metabox position
- I can’t access custom taxonomy page listing
- Post will not load via ajax
- Displayling list of Custom Post Type Posts
- List of Categories for Custom Post Type
- WordPress admin display post type tags as checkbox
- $post->post_meta not pulling any post in wordpress/php
- WordPress custom API endpoint – how to make the request more flexible
- How to Use Custom Meta Field Instead of CPT Title in Post URL
- Custom Post Type posts not showing in category
- Need alternative get_posts function for custom post type
- How to get post type information?
- How to display a WordPress Custom Field only on a specific day of the week?
- importing table data to custom post type
- is it possible in a custom post, create custom fields as well whitin?
- Take stored email addresses from custom post type & turn into one string
- WP_Query order custom post type with certain meta key value by post modified date
- How to show multiple images in a slideshow for a portfolio page
- How to eliminate custom posts where the “date” value is expired?
- restricting custom rewrite to just one custom post type
- How to show custom posts
- Pagination in custom post type archive.php not working
- Shortcode with loop stacks output
- How to filter a matched value with custom key using WP REST API?
- how to display author name in custom post type
- Sort custom post column by generated value?
- create a “add icon” field in taxonomies page
- Custom Post Type Pagination getting 404 error
- How to search through all child taxonomies using WP_Query?
- Custom Post Taxonomy Template Not Loading Properly
- WordPress retrieving $post based on random key in $_POST
- How can I use one instance of page.php to display different custom post types?
- Show ajax form resuslts in page
- PHP Notice: Unidentified index
- Unwanted URL with Custom Post Type
- wp_nav_menu doesn’t seem to work on custom post type pages
- Front page url permalink
- Custom meta box in editor of custom post type not working
- Calling in Post Content via AJAX
- How to retrieve json data from custom json enpoint created from a custom post type
- Multiple custom post type and permalink issue
- Using mediaelement to display gallery of audio
- Help ordering custom query by Title, Ascending
- How do I set a specific size for my image?
- group posts by month/date ignore years
- change precedence of permalink for post_types?
- Toggle a metabox based on a selection
- Image paths on custom post types getting /post_type/ added to path
- Problems with custom post type and hierarchical permalinks
- Issue on Adding Taxonomy to Custom Post Type Using Function
- Trying to display next and previous set of posts on separate page (not parent page)
- How is it possible to list custom post types by “category” like with simple posts?
- Limit wordpress posts loop to continue onto another page