Created
October 26, 2011 15:06
-
-
Save rachelbaker/1316622 to your computer and use it in GitHub Desktop.
Post Formats Icon Code
This file contains 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( 'aside' )) { | |
echo '<img class="post-icon"'; | |
echo 'src="'; | |
echo bloginfo('template_url'); | |
echo '/images/post-format-aside.png" alt="Aside Post" />'; | |
} | |
elseif ( has_post_format( 'image' )) { | |
echo '<img class="post-icon"'; | |
echo 'src="'; | |
echo bloginfo('template_url'); | |
echo '/images/post-format-image.png" alt="Image Post" />'; | |
} | |
elseif ( has_post_format( 'link' )) { | |
echo '<img class="post-icon"'; | |
echo 'src="'; | |
echo bloginfo('template_url'); | |
echo '/images/post-format-link.png" alt="Link Post" />'; | |
} | |
elseif ( has_post_format( 'quote' )) { | |
echo '<img class="post-icon"'; | |
echo 'src="'; | |
echo bloginfo('template_url'); | |
echo '/images/post-format-quote.png" alt="Quote Post" />'; | |
} | |
else { | |
echo '<img class="post-icon"'; | |
echo 'src="'; | |
echo bloginfo('template_url'); | |
echo '/images/post-format-standard.png" alt="Standard Post" />'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment