You can do:
if( 'video' == $post->post_type )
$play_button = '/images/btn-play.png';
elseif( 'slideshow' == $post->post_type )
$play_button = '/images/btn-ss.png';
Then render the button with:
<img src="https://wordpress.stackexchange.com/questions/4052/<?php echo get_bloginfo("template_directory') . $play_button; ?>" class="play" />
Hope that helps!
Related Posts:
- How do test if a post is a custom post type?
- If Post Type equals, then display X content
- Display several random posts, but make sure a condition is met
- Exclude custom function content from certain pages
- Function like in_category for custom taxonomies
- Can I create a loop with multiple post types and specify different $args for each post type?
- Search filter triggered & sort by custom post type
- Conditional for a Single Post That Belongs to a Category?
- Dynamically output a class to an anchor tag depending on what tag is chosen
- Check IF single OR multiple custom data has been entered
- If custom taxonomy else conditional [closed]
- Checking for custom field in admin pages
- I’m trying to create an if statement that will only display my button link for tickets if its under ‘admission-event’… what is wrong with my code?
- How can I check the rewrite slug of current post type listing page
- Multiple domains, Single database, 1 Parent/Master with all content, other domains/slaves with filtered content (based on “location” variable)
- Display content based on Author Custom Post type
- Loop to pull content from parent element in custom post type [duplicate]
- How to set up a echo? [closed]
- Advanced search form with filters for custom taxonomies and custom fields
- WordPress 3.3 custom post type with /%postname%/ permastruct?
- Show Custom Taxonomy Inside Custom Menu
- Custom Taxonomy’s Label to change the text appearing in Appearance > Menu
- Have different search results template depending of custom post type searched
- Why does a custom post type need the ”hierarchical’ args setting?
- How do I programmatically add items of content to a custom post type?
- Created a custom post type- can’t view it
- order by meta_value serialized array
- WP_Query pagination using only numbers instead of /page/1 on URL
- How do I set the content for a post of a particular CPT?
- Uploaded image not appearing in custom post type
- Custom Post Types – Titles as Taxonomies
- Slug for standard post post_type
- Parent page using wp_dropdown_pages and multiple post types
- Query for custom post type objects in a taxonomy and with a meta value
- Get post type from taxonomy or category page
- Add nonexisting pages to navigation
- How to add plugin custom field to custom post type?
- Multiple post type queries (with specific arguments for each)
- Is it possible to create a post using a metabox?
- related posts – pulling tags from a specific post type
- WP 3.0.5 – Custom posts matching 2 taxonomies
- Custom Post Type Loop within Shortcode
- How can you handle rewrite rules for custom post types with option to filter on custom taxonomy terms?
- Custom Post Type – Display Categories & Tags In Dashboard list
- How do I make a custom taxonomy for a CPT appear inbetween title and editor boxes?
- Custom Post Types – Change order of menu items
- What template files do I need to customise custom-category-term-links rather than fall back on archive.php?
- get the custom post type title/name
- WordPress 3.5 Media Uploader – Only allow 1 upload and certain file types
- wp_update_term_count_now doesn’t work with a custom post type?
- Custom post types as sub menu pages and role capabilities issue
- Troubles with acf/save_post and WP_Query
- Add custom field in comments form
- WordPress request fiter order by related post’s post_title
- Best method to make posts searchable, sortable and filterable – custom field, tag or category?
- Custom post with more than one custom taxonomy
- How to use manage_$post_type_posts_columns with underscore in post type?
- How to specify a template for a path like http://example.com/something?
- Categories and tags for custom post types
- WordPress 3.9 not using custom template
- Display different information of a custom post type
- uploading problem of wordpress theme
- Pagination doesn’t function properly for archive of a custom post type set as the front page
- How do you make a list and list item relation if custom post types?
- Two custom post types divided in two columns inside a bootstrap carousel
- Getting array_merge(): Argument #2 is not an array on register_post_type
- Is it possible to sort metabox teaxtarea values?
- How can I relate custom post types?
- creating files for displaying different custom post type posts with paging
- Sorting by meta_key different to search criteria?
- Display author box on just certain category posts?
- Custom post type posts wont show in wp_nav_menu()
- “Order” doesn’t work in custom loop?
- Permalink with hierarchy of Custom Post Types
- How do I set a post slug automatically based on taxonomy?
- Get a list of custom post type (property) when clicked on custom taxonomy 1 (rent or sale) from custom taxonomy 2 (city) page
- How to divide Subcategories into pages of parent category wordpress
- Is there any filter to add a custom attribute to the tag in admin panel?
- Display Posts that fit a certain criteria on Category pages
- Custom post type category returns null
- Custom post type order by post_title
- Tell wordpress to show a single page instead of an archive page
- Modify Url for Edit Post Screen in Custom Post Type
- How to get post by meta value
- Post display in separate page [duplicate]
- Create dynamic logo carousel without using any plugin
- Delete Post by User
- WordPress Contents Migration
- Custom post type translation
- Test for post type in request filter?
- What kind of post type structure do I need to manage a list of ranked skills?
- Have two (permalinks) urls for a same custom post type
- If taxonomy show class of active
- Custom Post Type Permalinks Problem
- Custom Post Types (Changing post style based on category)
- How to loop through custom posts in admin edit screen
- Notices when submitting custom post type from front-end
- querying to custom field over ACF REST API
- Fatal Error WordPress Custom Post Type UI + WPML
- get_the_post_navigation not working