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

No votes yet.
Please wait...
READ  Easy Google Analytics Events tracking in WordPress with GAS Injector
Continue Reading
You may also like...

We are a WordPress plugin developer company that focuses on useful WordPress plugin creation and empowering people to earn passive incomes from their blogs. We build unique and groundbreaking plugins that will revolutionize your blog!

Click to comment

Leave a Reply

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

More in wordpress

Sign up for our newsletter and get a free affiliate e-book!

About Me:

Szabi Kisded

Hi, my name is Szabi and I'm documenting my journey selling plugins on CodeCanyon. I will show you every step of it: learning to code, plugin ideas, WordPress stuff and more. Read more…

Mega Plugin Bundle:

CodeCanyon Portfolio:

Learn to Code Plugins:

Latest Promotions:

Recommended Theme:

Start Your Own Blog:

Recommended VPN:

Translate Your Blog:

AdSense Alternative:

Best Article Spinner:

Popular Posts:

Latest Posts:

To Top