Custom Post Formats for Custom Post Types

You have several options here so I will clarify what you can do. Create a custom post type template page using something like single-customposttype.php and take advantage of the template hierarchy, http://codex.wordpress.org/Template_Hierarchy Use a conditional query for your styling in the loop ( or whatever you’re using), along the line of if (post type= your … Read more

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

techhipbettruvabetnorabahisbahis forumutaraftarium24eduseduseduedusedueduedusedusedusedu