Hi,
I want to have thumbnails in front of my post text, but no other metadata.
I removed the child theme's (Powerblog) own metadata with the following code:
function childtheme_postheader() {
global $post;
if (is_page() || is_404() || is_home()) { ?>
<h2 class="entry-title"><a href="<?php the_permalink() ?>" title="<?php printf(__('Permalink to %s', 'thematic'), wp_specialchars(get_the_title(), 1)) ?>" rel="bookmark"><?php the_title() ?></a></h2>
<?php } else { ?>
<h1 class="entry-title"><a href="<?php the_permalink() ?>" title="<?php printf(__('Permalink to %s', 'thematic'), wp_specialchars(get_the_title(), 1)) ?>" rel="bookmark"><?php the_title() ?></a></h1>
<?php if ($post->post_type == 'post') { ?>
<div class="entry-meta">
<span class="author vcard"><span class="icon"><img src="/media/By.png" alt="" /></span> <?php _e(' ', 'thematic') ?><a class="url fn n" href="<?php get_author_link(true, $authordata->ID, $authordata->user_nicename); ?>" title="<?php __('View all posts by ', 'thematic') . the_author(); ?>"><?php the_author() ?></a></span>
<span class="meta-sep"> | </span>
<span class="entry-date"><abbr class="published" title="<?php get_the_time('Y-m-d\TH:i:sO'); ?>"><?php the_time('F jS, Y') ?></abbr></span>
</div><!-- .entry-meta -->
<?php } ?>
<?php }
}
add_filter ('thematic_postheader', 'childtheme_postheader');
But now I must add the thumbnail code, and I don't know how. I gave it a try but what follows is a total mess and although I don't understand why, I already knew by instinct this wasn't going to work:
//Post thumbnail support
add_theme_support('post-thumbnails');
function post_thumbnails($postmeta = get_the_post_thumbnail() ) {
$thumb = get_post_meta($post->ID, 'Thumbnail', $single = true);
$thumb_class = get_post_meta($post->ID, 'Thumbnail Class', $single = true);
$thumb_alt = get_post_meta($post->ID, 'Thumbnail Alt', $single = true);
if($thumb !== '') { ?>
<p>
<img src="<?php echo $thumb; ?>"
class="<?php if($thumb_class !== '') { echo $thumb_class; } else { echo "left"; } ?>"
alt="<?php if($thumb_alt !== '') { echo $thumb_alt; } else { echo the_title(); } ?>"
/>
</p>
<?php } // end if statement
// if there's not a thumbnail
else { echo ''; } ?>
<? php }
add_action('init', 'post_thumbnails');
Is there anyone who can tolerate this level of programming/logic ignorance and help me get this right?