Hi,
ich würde gerne meine Trackbacks und meine Kommentare trennen. Derzeit werden diese zusammengemischt innerhalb der Kommentare veröffentlicht.
Ich bin dazu auf folgende Seite gestoßen, die genau das abbildet, was ich haben möchte: [Wordpress] Kommentare und Trackbacks trennen - aptgetupdate.de
Leider schaffe ich es nicht, meine comments.php mit dem Vorschlag auf dieser Seite erfolgreich zu kombinieren. Kann mir jemand dabei helfen?
Meine comments.php sieht wie folgt aus:
PHP
<?php // Do not delete these lines
if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
die (__('Please do not load this page directly. Thanks!','simpla'));
if (!empty($post->post_password)) { // if there's a password
if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie
?>
<p class="nocomments"><?php _e('This post is password protected. Enter the password to view comments.','simpla'); ?><p>
<?php
return;
}
}
/* This variable is for alternating comment background */
$oddcomment = 'alt';
?>
<!-- You can start editing here. -->
<script type="text/javascript"><!--
google_ad_client = "pub-8894488939918643";
/* Anzeige auf der Einzelseite (Artikel) */
google_ad_slot = "7477999059";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<p>
<h3 id="comments">Artikeldetails für "<?php the_title(); ?>"</h3>
<ol class="commentlist">
<li class="<?php echo $oddcomment; ?>">
<strong>Autor:</strong> <?php the_author(); ?><br>
<strong>Datum:</strong> <?php the_date('d.m.Y'); ?> um <?php the_time('H:i'); ?> Uhr<br>
<p>
<strong>Themen:</strong> <?php the_category(', '); ?> <br>
<strong>Schlagworte:</strong> <?php the_tags('', ', ', '<br />'); ?> <br>
<strong>Verwandte Artikel:</strong> <?php similar_posts(); ?><br>
<p>
<strong>Statistiken:</strong> <?php if (function_exists('sayfa_sayac')) : ?><?php sayfa_sayac(1, 0, 1, 1); endif; ?>
<br>
<strong>Links:</strong> <a href="<?php get_permalink(id); ?>" target="_blank">Permanent Link</a> | <a href="<?php trackback_url(display); ?>" target="_blank">Trackback URL</a> | <?php comments_rss_link('Kommentar-Feed'); ?><br>
</li>
</ol>
<p><br><p>
<?php if ($comments) : ?>
<h3 id="comments"><?php printf(__('%1$s to “%2$s”','simpla'), comments_number(__('No Responses','simpla'), __('One Response','simpla'), __('% Responses','simpla')), get_the_title()) ?></h3>
<ol class="commentlist">
<?php $comments_counter = 1; ?>
<?php foreach ($comments as $comment) : ?>
<li class="<?php echo $oddcomment; ?>" id="comment-<?php comment_ID() ?>">
<strong><a href="#comment-<?php comment_ID() ?>" title="">#<?php echo $comments_counter ?></a></strong> |
<?php comment_author_link() ?> <?php _e('sagt:','simpla'); ?>
<?php if ($comment->comment_approved == '0') : ?>
<em><?php _e('Your comment is awaiting moderation.','simpla'); ?></em>
<?php endif; ?>
<br />
<small class="commentmetadata"><?php printf(__('%1$s at %2$s','simpla'), get_comment_date(__('d.m.Y','simpla')), get_comment_time('H:i')) ?></a></small>
<?php comment_text() ?>
</li>
<?php /* Changes every other comment to a different class */
if ('alt' == $oddcomment) $oddcomment = '';
else $oddcomment = 'alt';
?>
<?php $comments_counter++; ?>
<?php endforeach; /* end for each comment */ ?>
</ol>
<?php else : // this is displayed if there are no comments so far ?>
<?php if ('open' == $post->comment_status) : ?>
<!-- If comments are open, but there are no comments. -->
<?php else : // comments are closed ?>
<!-- If comments are closed. -->
<p class="nocomments"><?php _e('Comments are closed.','simpla'); ?></p>
<?php endif; ?>
<?php endif; ?>
<?php if ('open' == $post->comment_status) : ?>
<h3 id="respond"><?php _e('Leave a Reply','simpla'); ?></h3>
<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
<p><?printf( __('You must be <a href="%s">logged in</a> to post a comment.','simpla'), get_option('siteurl') . '/wp-login.php?redirect_to=' . get_permalink()) ?></p>
<?php else : ?>
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
<?php if ( $user_ID ) : ?>
<p><?php printf( __('Logged in as %s.','simpla'), '<a href="' . get_option('siteurl') . '/wp-admin/profile.php">' . $user_identity . '</a>') ?> <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="<?php _e('Log out of this account','simpla'); ?>"><?php _e('Logout','simpla'); ?> »</a></p>
<?php else : ?>
<p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" />
<label for="author"><small><?php _e('Name','simpla'); ?> <?php if ($req) echo __('(required)','simpla') ?></small></label></p>
<p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" />
<label for="email"><small><?php _e('Mail (will not be published)','simpla'); ?> <?php if ($req) echo __('(required)','simpla') ?></small></label></p>
<p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
<label for="url"><small><?php _e('Website','simpla'); ?></small></label></p>
<?php endif; ?>
<!--<p><small><?php printf(__('<strong>XHTML:</strong> You can use these tags: %s'), allowed_tags()) ?></small></p>-->
<p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>
<p><input name="submit" type="submit" id="submit" tabindex="5" value=<?php _e('Submit Comment','simpla'); ?> />
<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
</p>
<?php do_action('comment_form', $post->ID); ?>
</form>
<?php endif; // If registration required and not logged in ?>
<?php endif; // if you delete this the sky will fall on your head ?>
Alles anzeigen
Kann mir jemand die beiden Dinge so in der comments.php kombinieren, damit Trackbacks und Kommentare getrennt werden?
Für eure Hilfe danke ich euch jetzt schon :)
eha