Created
February 22, 2015 17:43
-
-
Save Aziz-Rahman/79d441dc880fe026bdc7 to your computer and use it in GitHub Desktop.
Post format wp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( has_post_format( 'video' ) ) { | |
echo '<div class="thumbnail"><div class="fluid-width-video-wrapper">'; | |
echo wp_oembed_get( get_field( 'video' ) ); | |
echo '</div></div>'; | |
} else if ( has_post_format( 'status' ) ) { | |
$featured_image = wp_get_attachment_url( get_post_thumbnail_id( $post->ID ) ); // Get featured image url | |
echo '<div class="thumbnail socmed-thumbnail" style="background: url('.$featured_image.') center center; background-size: cover;">'; | |
echo wp_oembed_get( esc_url( get_field( 'status' ) ) ); | |
echo '</div>'; | |
} else if ( has_post_format( 'audio' ) ) { | |
echo '<div class="thumbnail">'; | |
echo wp_oembed_get( get_field( 'audio' ) ); | |
echo '</div>'; | |
//etc | |
} else { | |
echo '<div class="thumbnail">'; | |
the_post_thumbnail( 'blog-image' ); | |
echo '</div>'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment