Depending on which ‘types’ you need, you might be looking for the Post Format functionality. It allows you to set posts as standard, quotes, galleries, etc (sort of like Tumblr). To activate it, simply toss this into your theme (probably functions.php):
add_theme_support( 'post-formats', array( 'aside', 'gallery', 'quote' ) );
Then, in your templates, you’ve got some options. You can either use conditionals to go wild in single.php, or you can make PHP files for each post format. Inside single.php, you’d want something like this:
get_template_part( 'content', get_post_format() );
Which will check for the post format and load the appropriate file. That way, a gallery formatted post can easily have something like:
do_shortcode('')
already inserted. The templates will just know when a gallery is being displayed and automatically show images.
Is that what you’re after?
Related Posts:
- How can I add dropdown widget/box to admin post page?
- Newer/Older posts links display same posts on every page
- List events by month
- How do I write this SQL statement for Posts written in last 24 hours?
- How to show related posts by category or custom post type?
- Custom post type loops with different page templates
- How to create posts (not post template) to be displayed on projects page?
- Limit Authors to their Own Posts on front-end excluding admins
- IF statement in a do_shortcode
- How do you output custom code between posts in the loop?
- How to append element after thumbnail
- Why does using WP_Query inside a shortcode in an elementor page cause the arguments for WP_Query to get malformed?
- I am having a problem with form updating/editing WordPress post on the frontend
- Display custom field of specific post where post title matches variable
- get_template_part for custom post type content not working
- Loop on front-page.php
- WP_Query is printing out only one post when posts_per_page is set to multiple
- How to get all posts except for one post from a certain custom post type?
- Create a random unique 6 digit number as custom field for custom post type
- Blog page showing same content as homepage
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- Very Slow Page – How to Optimize # of Queries?
- How i can add ‘N’ page of ‘N’ pages under posts loop?
- Custom Post Type Loop throws 500 error when used in widget
- How to make sure content doesn’t display if selection is empty
- CPT + CMB2: data not displaying for only first post in loop
- How do i calculate the total of values of custom fields in custom post types?
- Checking if Post Title is Unique as Loop Criteria
- List custom taxonomy specific to one custom post type
- Custom Tag Description unable to display just below and outside of the Loop
- Shortcode not working with post counter
- Conditional for a Single Post That Belongs to a Category?
- Including all post id’s of a custom post type into an array
- How can I group posts by months and years?
- Trying to Create a PHP Variable for post_type that can be referenced Site Wide
- Using wp_query to modify the loop in index.php for a CPT
- Control content before and after custom post type loop
- How to Make infinite loop of post
- WP_Query with custom post type ID
- Get data from PHP to JavaScript to set position of each post on front page
- display posts of custom post type with custom taxonomy
- Get post format
- How to add new post using a form to categories when categories are using as menu
- Custom wordpress loop
- How to set the mainpage of a custom post type?
- Different post title, keywords and description
- displaying content of custom post type
- Posts are not rendering perfectly [closed]
- Template code to split a post and print a custom field?
- Display post from custom post type
- Use post in multiple places on a page with multiple posts
- foreach loop inside the loop creating duplicates in output
- Compare Two Custom Post Types Using The Same Custom Taxonomy
- How to fetch posts that are stored in the different table than (default) wp_posts?
- If/Else child list for Custom Post Type single template within loop?
- How can I increase the post count for custom post types only?
- Fetch data from two custom post types and create multidimensional array for output to html table
- redirect after submiting post for review
- Page that lists publications by classifying them by taxonomy
- CPT loop doesn’t seem to account for post date?
- What is the best way to set the post category (Custom Post Type) automatically based on the one of the tags assigned to the post?
- Is it possible to get the specific content on the search page?
- Why is my custom post content only viewable when signed into WordPress?
- How to change Elementor Template for Single Page Post on Load
- open custom post type in popup window instead of page
- WordPress – display relationship between blog posts and custom posts
- when looping through custom post data not appearing
- wp_post_delete is deleting all offices
- SEARCH QUERIES – REVERSE OUTPUT
- Accessing download link from the loop with WP Download Manager Pro
- Custom Post Type has wrong label and is not found when called by a loop
- Combine multiple separate lists into one
- Looping to organize and display custom posts by category using PHP and WordPress
- Show parent category and subcategory once in while loop
- How can I group by Taxonomy on Custom Post Type while filtering out based on custom Meta
- subtracting the current post form then whole loop, which is generating all CPT titles
- Custom Post By Category
- Custom post Query and WordPress Post Query Clash
- How to get the posts that my following users are liked?
- Add active class to foundation 6 tabs while looping categories
- Display related post content and custom field content
- WordPress loop add heading before first of type
- Only show current category post
- How to make a shortcode for my WP_Query Loop? [duplicate]
- Strange behavior on WP_query
- get_post_meta for Custom Post Type ( CPT )
- WordPress query posts by custom post type not workng
- Featured image in custom post is being disabled
- How To Loop Through list with Custom Post Types
- How to create content automatically when a post is published?
- WordPress Custom Post Type and sort by Tags
- Posts without featured image using other post’s featured image
- Turn post into simple slideshow
- Looping taxonomy in taxonomy?
- Pulling in a particular post into a single page based on the post id passed into the code
- Styling first post using Advanced Custom Fields
- Query Custom Post Type by Tag
- How do I filter a custom post type loop by a field?
- the_content() stop images being pulled through
- How to hide home title on pages and posts?