Hallo,
ich habe versucht in meine single.php das Post-Thumbnail einzubauen.
Allerdings funktioniert es nicht, sprich, es wird nicht dargestellt. In der functions.php ist die Funktion aktiviert, warum also geht es nicht?
Sieht von euch jemand einen Fehler?
Es geht um folgenden Teil:
PHP
<div id="side_2"><?php the_post_thumbnail(); ?><br/><br/>
Genre: <?php $key="genre"; echo get_post_meta($post->ID, $key, true); ?><br/>
Gründungsjahr: <?php $key="jahr"; echo get_post_meta($post->ID, $key, true); ?><br/>
Bandmitglieder: <?php $key="mitglieder"; echo get_post_meta($post->ID, $key, true); ?><br/><br/>
Hier die gesamte single.php:
PHP
<?php get_header() ?>
<div id="content_2">
<div class="padder">
<?php do_action( 'bp_before_blog_single_post' ) ?>
<div class="page2">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="item-options">
<div class="alignleft"><?php next_posts_link( __( '← Previous Entries', 'buddypress' ) ) ?></div>
<div class="alignright"><?php previous_posts_link( __( 'Next Entries →', 'buddypress' ) ) ?></div>
</div>
<div class="post" id="post-<?php the_ID(); ?>">
<div id="side_2"><?php the_post_thumbnail(); ?><br/><br/>
Genre: <?php $key="genre"; echo get_post_meta($post->ID, $key, true); ?><br/>
Gründungsjahr: <?php $key="jahr"; echo get_post_meta($post->ID, $key, true); ?><br/>
Bandmitglieder: <?php $key="mitglieder"; echo get_post_meta($post->ID, $key, true); ?><br/><br/>
<a href="http://www.soundjournal.de/edit/?tdomf_post_id=<?php the_ID(); ?>"><b>Eintrag bearbeiten</b></a>
</div>
<div class="post-content">
<h2 class="posttitle"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php _e( 'Permanent Link to', 'buddypress' ) ?> <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<p class="date"><?php the_time('F j, Y') ?> <em><?php _e( 'in', 'buddypress' ) ?> <?php the_category(', ') ?> <?php printf( __( 'by %s', 'buddypress' ), bp_core_get_userlink( $post->post_author ) ) ?></em></p>
<div class="entry">
<?php the_content( __( 'Read the rest of this entry →', 'buddypress' ) ); ?>
<?php wp_link_pages(array('before' => __( '<p><strong>Pages:</strong> ', 'buddypress' ), 'after' => '</p>', 'next_or_number' => 'number')); ?>
</div>
<p class="postmetadata"><span class="tags"><?php the_tags( __( 'Tags: ', 'buddypress' ), ', ', '<br />'); ?></span> <span class="comments"><?php comments_popup_link( __( 'No Comments »', 'buddypress' ), __( '1 Comment »', 'buddypress' ), __( '% Comments »', 'buddypress' ) ); ?></span></p>
</div>
<?php
$tags = wp_get_post_tags($post->ID);
if ($tags) {
echo 'Alben dieses Künstlers:';
$first_tag = $tags[0]->term_id;
$args=array(
'tag__in' => array($first_tag),
'post__not_in' => array($post->ID),
'showposts'=>5,
'caller_get_posts'=>1
);
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<br/><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_post_thumbnail(); ?><br><?php the_title(); ?></a>
<?php
endwhile;
}
}
?> </div>
<?php comments_template(); ?>
<?php endwhile; else: ?>
<p><?php _e( 'Sorry, no posts matched your criteria.', 'buddypress' ) ?></p>
<?php endif; ?>
<br/><script type="text/javascript"><!--
google_ad_client = "pub-xyz";
/* 468x60, Erstellt 17.07.10 */
google_ad_slot = "2401561132";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<?php do_action( 'bp_after_blog_single_post' ) ?>
</div><!-- .padder -->
</div><!-- #content -->
<?php get_footer() ?>
Alles anzeigen
Gruß und Dank im voraus, duff