Hi zusammen,
ich habe das Problem bei meinem WordPress, dass die Links in den Ajax-Kommentaren manchmal ein neues Fenster öffnen und manchmal auch nicht. Irgendwie voll dumm, dass das rel="external" einfach nicht konstant ausgeführt wird.
Hier mal der Code der ajax-comments.php meines Tonus-1.8-Themes:
PHP
<?php
require_once('../../../wp-config.php');
global $comment, $comments, $post, $wpdb, $authordata;
$id = (int) $_POST['id'];
$post = &get_post($id);
$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$id' AND comment_approved = '1' ORDER BY comment_date");
$authordata = get_userdata($post->post_author);
?>
<?php $comment_num = 1; //initialize comment counter ?>
<div id="comText<?php echo $id; ?>">
<div class="ajax-comments-wrapper">
<?php foreach ($comments as $comment) : ?>
<?php $authcomment=''; if ($comment->comment_author_email == $authordata->user_email) { $authcomment=1; } ?>
<div class="ajax-comment<?php if ($authcomment) {echo '-alt';} ?>">
<div class="ajax-comment-header<?php if ($authcomment) {echo '-alt';} ?>"><a id="comment-<?php comment_ID() ?>"></a>
<span class="ajax-comment-info">
<?php if ('' == $comment->comment_type) { ?>
<?php comment_date('d.m.Y') ?> |
<?php comment_time('G:i') ?> |
#<?php echo $comment_num; ?>
<?php } elseif ('trackback' == $comment->comment_type) { ?>
<?php _e('Trackback'); ?>
<?php } elseif ('pingback' == $comment->comment_type) { ?>
<?php _e('Pingback'); ?>
<?php } ?>
</span>
<span class="ajax-comment-author"><?php comment_author_link('rel="external"') ?></span>
</div>
<div class="ajax-comment-text">
<?php comment_text('rel="external"') ?>
</div>
</div>
<?php $comment_num++; ?>
<?php endforeach; /* end for each comment */ ?>
<span class="ajax-options"><a href="<?php comments_link(); ?>">Kommentieren</a></span>
</div>
</div>
Alles anzeigen
Gruß,
Simon
Anwendungsbeispiel: http://www.elsimmes.de.tt/