Hallo zusammen,
ich habe in meinem Blog momentan den Gravatar bei den Kommentaren aktiv.
Nun möchte ich gerne einerseits auf der Hauptseite bei der Beitragsübersicht ebenfalls den Gravatar des jeweiligen Autors in der Titelzeile des jeweiligen Beitrags (war das jetzt zu kompliziert ausgedrückt *fg* ?) und andererseits auch, wenn man direkt in den Beitrag reingeht, ebenfalls in der Titelzeile.
Gravatar sollte rechts platziert sein in der Titelzeile.
Ich paste hier mal den Code von der index.php und der single.php hinein:
index.php:
<?php get_header(); ?>
<div id="content">
<?php
if(is_home()) echo '<div class="spacer"> </div>';
if (have_posts()) :
$post = $posts[0]; // Hack. Set $post so that the_date() works.
if(is_category()){
echo '<h3 class="archivetitle">Archive for the Category »'.single_cat_title('',FALSE).' «</h3>';
}elseif(is_day()){
echo '<h3 class="archivetitle">Archive for » '.get_the_time('F jS, Y').'«</h3>';
}elseif(is_month()){
echo '<h3 class="archivetitle">Archive for » '.get_the_time('F, Y').' «</h3>';
}elseif(is_year()){
echo '<h3 class="archivetitle">Archive for » '.get_the_time('Y').' «</h3>';
} elseif(is_search()){
echo '<h3 class="archivetitle">Search Results</h3>';
}elseif(is_author()){
echo '<h3 class="archivetitle">Author Archive</h3>';
}elseif(isset($_GET['paged']) && !empty($_GET['paged'])){ // If this is a paged archive
echo '<h3 class="archivetitle">Blog Archives</h3>';
}elseif(is_tag()){
echo '<h3 class="archivetitle">Tag-Archive for » '.single_tag_title('',FALSE).' « </h3>';
}
while (have_posts()) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="post_title">
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a>
<div class="post_author"><?php the_author_posts_link('nickname'); ?> <?php edit_post_link(' Edit ',' »','«'); ?></div>
</div>
<div class="post_date">
<div class="post_date_d"><?php the_time('d');?></div>
<div class="post_date_m"><?php the_time('M Y');?></div>
</div>
<div class="entry clear">
<?php if (is_search()){
the_excerpt();
}else{
the_content('more...');
}
?>
</div>
<div class="clear"></div>
<div class="info">
<span class="category">Category: <?php the_category(', ') ?></span>
<?php the_tags(' <span class="tags">Tags: ', ', ', '</span>'); ?>
<span class="bubble"><?php comments_popup_link('Leave a Comment','One Comment', '% Comments', '','Comments off'); ?></span>
</div>
</div>
<?php
endwhile;
?>
<div class="navigation">
<div class="alignleft"><?php next_posts_link('« Previous Entries') ?></div>
<div class="alignright"><?php previous_posts_link('Next Entries »') ?></div>
</div>
<?php else : ?>
<h3 class="archivetitle">Not found</h3>
<p class="sorry">"Sorry, but you are looking for something that isn't here. Try something else.</p>
<?php
endif;
?>
</div>
<?php get_sidebar(); ?>
<?php get_footer();?>
Alles anzeigen
single.php:
<?php get_header(); ?>
<div id="content">
<div class="spacer"></div>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="post_title">
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a>
<div class="post_author"><?php the_author_posts_link('nickname'); ?> <?php edit_post_link(' Edit ',' »','«'); ?></div>
</div>
<div class="post_date">
<div class="post_date_d"><?php the_time('d');?></div>
<div class="post_date_m"><?php the_time('M Y');?></div>
</div>
<div class="entry clear">
<?php the_content('more...'); ?><div class="clear"></div>
<?php wp_link_pages(array('before' => '<div><strong><center>Pages: ', 'after' => '</center></strong></div>', 'next_or_number' => 'number')); ?>
</div>
<div class="info">
<span class="category">Category: <?php the_category(', ') ?></span>
<?php the_tags(' <span class="tags">Tags: ', ', ', '</span>'); ?>
</div>
</div>
<div id="postmetadata">
You can follow any responses to this entry through the <?php comments_rss_link('RSS 2.0'); ?> feed.
<?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) { // Both Comments and Pings are open ?>
You can <a href="#respond">leave a response</a>, or <a href="<?php trackback_url(); ?>" rel="trackback">trackback</a> from your own site.
<?php }elseif(!('open' == $post-> comment_status) && ('open' == $post->ping_status)) { // Only Pings are Open ?>
Responses are currently closed, but you can <a href="<?php trackback_url(); ?> " rel="trackback">trackback</a> from your own site.
<?php }elseif(('open' == $post-> comment_status) && !('open' == $post->ping_status)){ // Comments are open, Pings are not ?>
You can skip to the end and leave a response. Pinging is currently not allowed.
<?php } elseif (!('open' == $post-> comment_status) && !('open' == $post->ping_status)) { // Neither Comments, nor Pings are open ?>
Both comments and pings are currently closed.
<?php }
edit_post_link('Edit this entry','(',')');
?>
</div>
<?php
comments_template();
?>
<?php
endwhile;
?>
<div class="navigation">
<div class="alignleft"><?php previous_post_link('« %link') ?></div>
<div class="alignright"><?php next_post_link('%link »') ?></div>
</div>
<?php
else : ?>
<h3 class="archivetitle">Not found</h3>
<p class="sorry">"Sorry, but you are looking for something that isn't here. Try something else.</p>
<?php
endif;
?>
</div>
<?php get_sidebar(); ?>
<?php get_footer();?>
Alles anzeigen
Ich möchte also nicht nur meinen eigenen Gravatar haben, sondern immer den Gravatar des jeweiligen Autors ! Was muss ich wo einfügen ? Könnt Ihr mir da Tipps geben ?
Ich nutze übrigens WP 2.7 !
Vielen Dank vorab für Eure Hilfe,
Chris