Skip to content

Instantly share code, notes, and snippets.

@talstadler
Created May 28, 2011 12:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save talstadler/996824 to your computer and use it in GitHub Desktop.
Save talstadler/996824 to your computer and use it in GitHub Desktop.
adding thumbnails
<?php
// Custom Child Theme Functions
// First we make our function
function childtheme_welcome_blurb() {
if (is_home() & !is_paged()) { ?>
<div id="welcome-blurb">
<p>Red Pyramids is<br>
Tal Stadler's space for<br>
design and words /<br>
words and design<br>
Serach different angle></br> <?php bloginfo('name'); ?>.</p>
</div>
<?php }
}
add_action('thematic_belowheader','childtheme_welcome_blurb');
function childtheme_posttitle($posttitle) {
return '<div class="containing">' . $posttitle . '</div>';
}
add_filter('thematic_postheader_posttitle','childtheme_posttitle');
/* Homepage
__________________________________________*/
function childtheme_hp_thumbs(){
}
//Supporting thumbnails in WP:
if ( function_exists( 'add_theme_support' ) ) {
add_theme_support( 'post-thumbnails' );
}
function childtheme_content($unfiltered) { //pass the original unfiltered content
if (is_home()){ // if this is the home page
?>
<a href="<?php the_permalink(); ?>"><?php //call the link to the post
if ( has_post_thumbnail() ) { // if the post has a Post Thumbnail
the_post_thumbnail(array(100,100)); //use it in 100px maximum
} else {
the_title(); //use the title of the post
}
?></a><?php //close the link
} else { //if it's not the homepage
echo $unfiltered; //forget about it, use the original content
}
}
add_filter('the_content','childtheme_content'); //filter the_content with our function
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment