Hallo zusammen,
ich versuche seit über einer Woche die Kommentare mit in die Beitragsübersicht zu integrieren.
Leider wird bisher nur der Button ohne Funktion angezeigt.
So soll das Ganze aussehen:
So habe ich versucht die Klasse expandlink in die archiv.php zu integrieren:
Hier noch meine comments-legacy.php und comments.php:
comments-legacy.php:
<?php // Do not delete these linesif (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
die ('Please do not load this page directly. Thanks!');
if ( post_password_required() ) { ?>
<p class="nocomments">This post is password protected. Enter the password to view comments.</p>
<?php
return;
}
// add a microid to all the comments
function comment_add_microid($classes) {
$c_email=get_comment_author_email();
$c_url=get_comment_author_url();
if (!empty($c_email) && !empty($c_url)) {
$microid = 'microid-mailto+http:sha1:' . sha1(sha1('mailto:'.$c_email).sha1($c_url));
$classes[] = $microid;
}
return $classes;
}
add_filter('comment_class','comment_add_microid');
// show the comments
if ( have_comments() ) : ?>
<h4 id="comments"><?php comments_number('No Comments', 'One Comment', '% Comments' );?></h4>
<ul class="commentlist" id="singlecomments">
<?php wp_list_comments(array('avatar_size'=>48, 'reply_text'=>'Reply to this Comment')); ?>
</ul>
<div class="navigation">
<div class="alignleft"><?php previous_comments_link() ?></div>
<div class="alignright"><?php next_comments_link() ?></div>
</div>
<?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.
else :
// comments are closed
endif;
endif;
if ('open' == $post-> comment_status) :
// show the form
?>
<div id="respond"><h3><?php comment_form_title(); ?></h3>
<div id="cancel-comment-reply">
<small><?php cancel_comment_reply_link(); ?></small>
</div>
<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
<p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">logged in</a> to post a comment.</p>
<?php else : ?>
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
<?php if ( $user_ID ) : ?>
<p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>.
<a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="Log out of this account">Logout »</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>Name <?php if ($req) echo "(required)"; ?></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>Email <?php if ($req) echo "(required)"; ?></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>Website</small></label></p>
<?php endif; ?>
<div>
<?php comment_id_fields(); ?>
<input type="hidden" name="redirect_to" value="<?php echo htmlspecialchars($_SERVER["REQUEST_URI"]); ?>" /></div>
<p><small><strong>XHTML:</strong> You can use these tags: <?php echo allowed_tags(); ?></small></p>
<p><textarea name="comment" id="comment" cols="10" rows="10" tabindex="4"></textarea></p>
<?php if (get_option("comment_moderation") == "1") { ?>
<p><small><strong>Please note:</strong> Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.</small></p>
<?php } ?>
<p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" /></p>
<?php do_action('comment_form', $post->ID); ?>
</form>
<?php endif; ?>
</div>
<?php
endif;
Alles anzeigen
comments.php
<?php // Do not delete these lines
if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
die ('Please do not load this page directly. Thanks!');
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">This post is password protected. Enter the password to view comments.</p>
<?php
return;
}
}
$oddcomment = ' alt';
?>
<!-- You can start editing here. -->
<div class="postComments" id="comments">
<?php if ( have_comments() ) : ?>
<h2><?php comments_number('0 Comments', '1 Comment', '% Comments' );?>. </h2>
<div class="commentlist">
<?php wp_list_comments('callback=custom_comment'); ?>
</ol>
<div class="blogNavigation">
<div class="alignleft"><?php previous_comments_link() ?></div>
<div class="alignright"><?php next_comments_link() ?></div>
<div class="clear"></div>
</div>
<?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. -->
<p class="commentP">Post the first comment!</p>
<?php else : // comments are closed ?>
<!-- If comments are closed. -->
<p class="commentP">Comments are closed.</p>
<?php endif; ?>
<?php endif; ?>
</div>
<?php if ('open' == $post->comment_status) : ?>
<div class="commentForm" id="respond">
<h2><?php comment_form_title( 'Leave a Reply', 'Leave a Reply to %s' ); ?>!</h2>
<p><small><?php cancel_comment_reply_link(); ?></small></p>
<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
<p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">logged in</a> to post a comment.</p>
<?php else : ?>
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
<?php if ( $user_ID ) : ?>
<p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo wp_logout_url(); ?>" title="Log out of this account">Logout »</a></p>
<?php else : ?>
<label for="author">Your Name:</label>
<input class="input" type="text" name="author" id="author" value="" tabindex="1" />
<label for="email">Email:</label>
<input class="input" type="text" name="email" id="email" value="" tabindex="2" />
<label for="url">Website (optional):</label>
<input class="input" type="text" name="url" id="url" value="" tabindex="3" />
<?php endif; ?>
<label for="comment">Comment:</label>
<textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea>
<input name="submit" type="submit" id="submit" tabindex="4" value="" class="submit" />
<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
<?php comment_id_fields(); ?>
<?php do_action('comment_form', $post->ID); ?>
</form>
</div>
<?php endif; // If logged in ?>
<?php endif; // don't delete, kay? ?>
Alles anzeigen
Leider kann ich keine URL dazu liefern, da das System nur für das Intranet gedacht ist und sich daher nicht in der DMZ befindet.