Put things in folders and stuff

This commit is contained in:
Brian Miyaji
2014-01-06 22:32:15 +11:00
parent 4e53aa5424
commit 3ab4ea33bd
26 changed files with 574 additions and 528 deletions

View File

@@ -0,0 +1,15 @@
<?php
function sp_post_thumbnail_html( $html, $post_id, $post_thumbnail_id, $size, $attr ) {
if( empty ( $html ) && in_array( get_post_type( $post_id ), array( 'sp_team', 'sp_tournament' ) ) ) {
$parents = get_post_ancestors( $post_id );
foreach ( $parents as $parent ) {
if( has_post_thumbnail( $parent ) ) {
$html = get_the_post_thumbnail( $parent, $size, $attr );
break;
}
}
}
return $html;
}
add_filter( 'post_thumbnail_html', 'sp_post_thumbnail_html', 10, 5 );
?>