Connect with us

[WordPress] Post Formats Meta Information


[WordPress] Post Formats Meta Information

I was busy working with WordPress since last couple of months. In WordPress version 3.1, WordPress announce new feature “Post Format” which is meta information of post to improve the look and presentation of the post. It is very easy to use and very helpful for making attractive theme.

By default, WordPress provides 9 post formats which you can refer on below link.

1. Aside
2. Gallery
3. Link
4. Image
5. Quote
6. Status
7. Video
8. Audio
9. Chat

By default post format is not added for any post type. You need to add couple of line to make it visible in admin and use the post formats meta information features.

You can use below code to make post formats visible in wp admin for add/edit posts. Add this line in your theme’s functions.php file.

add_theme_support( 'post-formats', array( 'aside', 'gallery' ) );

Above code will make post format visible for post only. If you want to use post format feature for page and custom post types than follow the below line of code.

// add post-formats to post_type 'page'
add_post_type_support( 'page', 'post-formats' );
// add post-formats to post_type 'my_custom_post_type'
add_post_type_support( 'my_custom_post_type', 'post-formats' );

Once you assign post formats to posts than you can retrieve it using below line of code.

if ( has_post_format( 'video' ))

You can assign post format to group of posts and assign some icons to determine the post. This makes your theme more attractive.

Post Formats in WordPress, New Post Format, Get Post Format WordPress, Post Format for Custom Post Type, Post Format Meta Information, Post Format Support Theme

Continue Reading
Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

More in wordpress

About Me:

Szabi Kisded

Hey there, I'm Szabi. At 30 years old, I quit my IT job and started my own business and became a full time WordPress plugin developer, blogger and stay-at-home dad. Here I'm documenting my journey earning an online (semi)passive income. Read more

Sign up for my newsletter and get the YouTube Caption Scraper WordPress plugin for free
(worth 29$)!

All My Plugins In A Bundle:

My AutoBlogging Plugins:

My Online Courses:

A Theme I Recommend:

Featured Posts:

To Top