Home / Archive / add post formats
Duplicate Snippet

Embed Snippet on Your Site

add post formats

Adding different types of post formats:

aside – Typically styled without a title. Similar to a Facebook note update.
gallery – A gallery of images. Post will likely contain a gallery shortcode and will have image attachments.
link – A link to another site. Themes may wish to use the first tag in the post content as the external link for that post. An alternative approach could be if the post consists only of a URL, then that will be the URL and the title (post_title) will be the name attached to the anchor for it.
image – A single image. The first tag in the post could be considered the image. Alternatively, if the post consists only of a URL, that will be the image URL and the title of the post (post_title) will be the title attribute for the image.
quote – A quotation. Probably will contain a blockquote holding the quote content. Alternatively, the quote may be just the content, with the source/author being the title.
status – A short status update, similar to a Twitter status update.
video – A single video. The first tag or object/embed in the post content could be considered the video. Alternatively, if the post consists only of a URL, that will be the video URL. May also contain the video as an attachment to the post, if video support is enabled on the blog (like via a plugin).
audio – An audio file. Could be used for Podcasting.
chat – A chat transcript

Code Preview
php
<?php
// available formats:
// aside, gallery, link, image, quote, status, video, audio, chat
function theme_post_formats_setup() {
	add_theme_support( 'post-formats', array( 'quote', 'image', 'link', 'gallery', 'status', 'aside', 'chat' ) );
}
		   
add_action( 'after_setup_theme', 'theme_post_formats_setup' );
	
// If using a child theme
		   
add_action( 'after_setup_theme', 'childtheme_formats', 11 );
function childtheme_formats() {
	 add_theme_support( 'post-formats', array( 'quote', 'image', 'link', 'gallery', 'status', 'aside', 'chat' ) );
}

Comments

Add a Comment