Skip to content

Instantly share code, notes, and snippets.

@utkarshkukreti
Forked from tylerbcunning/testhook.php
Created October 27, 2011 22:31
Show Gist options
  • Save utkarshkukreti/1321097 to your computer and use it in GitHub Desktop.
Save utkarshkukreti/1321097 to your computer and use it in GitHub Desktop.
example
<?php
/**
* Check for post format type, apply filter based on post format name for easy modification.
*
* @since 1.0
*/
function chimps_post_formats_content() {
$format = get_post_format();
$root = get_template_directory_uri();
ob_start();
?>
<div class="post_container">
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
<div class ="format-icon"><img src="<?php echo $root ;?>/images/formats/<?php echo $format;?>.png" height="50px" width="50px" /></div><h2 class="posts_title"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
<div class="entry">
<?php the_content(); ?>
</div>
</div><!--end post_class-->
</div><!--end post_container-->';
<?php
$content = ob_get_clean();
$content = apply_filters( 'chimps_post_formats_'.$format.'content', $content );
return $content;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment