How do I remove the post format meta box?

That gets added because your theme supports post-formats. You can either use a plugin (or a child theme’s functions.php) file to hook into after_setup_theme late and remove theme support: <?php add_action(‘after_setup_theme’, ‘wpse65653_remove_formats’, 100); function wpse65653_remove_formats() { remove_theme_support(‘post-formats’); } Or look for the the line in your theme’s functions.php file: add_theme_support(‘post-formats’); and remove it. The first … Read more

What difference does it make if I enable support for video post format?

Couple of things to point out actually: It will add a class on post_class() so you can use different formatting via css. In the case of Post Formats, the taxonomy is post_format and the terms are post-format-{format}. i.e. taxonomy-post_format-post-format-link.php http://codex.wordpress.org/Template_Hierarchy In single.php file you can use conditionals to have complete different html for each post … Read more

static variable loop not working in WordPress

Try something like this: function realistic_get_first_embed_video($post_id) { $post = get_post($post_id); $content = do_shortcode(apply_filters(‘the_content’, $post->post_content)); $embeds = get_media_embedded_in_content($content); if (!empty($embeds)) { //check what is the first embed containg video tag, youtube or vimeo $counter = 0; foreach ($embeds as $embed) { // Check condition if count is 0 then // it is the first iteration if( … Read more

How to filter by post-format in admin?

Try this plugin i cooked up: <?php ! defined( ‘ABSPATH’ ) AND exit; /** * Plugin Name: (#26032) WP_List_Table Post Format filter extension * Plugin URI: http://wordpress.stackexchange.com/questions/26032/how-to-filter-by-post-format-in-admin * Description: Filters the admin WP_List_Table by post format * Author: Bainternet * Author URI: http://en.bainternet.info */ function wpse26032_admin_posts_filter( &$query ) { if ( is_admin() AND ‘edit.php’ === … Read more

Display/query post formats

You have a lot of options for displaying using the “Post Formats” feature: for example in an index.php loop you can decide what to show based on the post format using has_post_format() function : if ( has_post_format( ‘aside’ )) { echo the_content(); } elseif ( has_post_format( ‘chat’ )) { echo ‘<h3>’; echo the_title(); echo ‘</h3>’; … Read more

How to set a default format for a custom post type?

One option would be to modify the global Default Post Format setting, via Dashboard -> Settings -> Writing. Note that this setting is global, so it would set the default for all post types that support Post Formats. If you have no need of post formats for blog Posts, you could simply enable post-format support … Read more

Is it possible to rename a post format?

I think this is the only way for now. Put this in your functions.php in your theme folder or create a simple plugin: function rename_post_formats( $safe_text ) { if ( $safe_text == ‘Aside’ ) return ‘Quick’; return $safe_text; } add_filter( ‘esc_html’, ‘rename_post_formats’ ); //rename Aside in posts list table function live_rename_formats() { global $current_screen; if … Read more

Are content.php and content-single.php the same?

No, content.php and content-single.php are not the same thing. In your example CODE: if (get_post_format() == false) { get_template_part(‘content’, ‘single’); } else { get_template_part(‘content’, get_post_format()); } WordPress will load content-single.php when get_post_format() is false. However, get_template_part( $slug, $name ) may still try to load content.php when you call it with get_template_part(‘content’, get_post_format()); in the following … Read more