Hallo,
folgendes Problem: In meinem Blog gibt's in den Kommentaren die Möglichkeit, einen Website-Link anzugeben. Dieser wird aber nicht an Wordpress übergeben, d.h. er erscheint weder im Kommentar noch im Backend. Geh ich auf "Kommentar bearbeiten" und gebe da die URL ein wird diese auch in den Kommentaren im Frontend angezeigt.
Hier der Code meiner Comments.php (nicht über schlechten Code meckern, ich bastel gerade ;))
PHP
<div id="comments">
<?php foreach ($comments as $comment) : ?>
<div class="comment" id="comment-<?php comment_ID() ?>">
<?php echo get_avatar( get_the_author_email(), '45', '/images/no_images.jpg', get_the_author() ); ?>
<span style="margin-left: 60px; display: block;"><b><?php if ($comment->comment_author_url != "" && $comment->comment_author_url != "http://") { ?>
<a href="<?php comment_author_url(); ?>"><?php comment_author(); ?>:</a>
<?php } else { ?>
<?php comment_author(); ?>:
<?php } ?></b><?php echo get_comment_text(); ?></span>
<?php if ($comment->comment_approved == '0') : ?>
<strong>Achtung: Dein Kommentar muss erst noch freigegeben werden.</strong><br />
<?php endif; ?>
</div>
<div style="margin-top: -20px"class="line"></div>
<?php endforeach; /* end for each comment */ ?>
<div id="kommentar_formular">
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
<input type="text" name="author" style="width: 125px; float: left; margin-right: 5px;" id="author" placeholder="Name" value="<?php echo $comment_author; ?>" size="22" />
<input type="text" style="width: 125px;" name="email" id="email" placeholder="E-Mail (nicht öffentlich)" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" />
<input type="text" name="url" id="url" placeholder="Website" style="width: 125px; float: left; margin-right: 5px;" value="<?php echo $comment_author_url_link; ?>" size="22" tabindex="3" />
<p>
<textarea name="comment" placeholder="Kommentar" id="comment" style="width: 100%;" rows="10" tabindex="4"></textarea>
<input name="submit" class="btn" type="submit" id="submit" tabindex="5" value="Abschicken" />
<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
</p>
<?php do_action('comment_form', $post->ID); ?>
</form>
</div> <!-- kommentar_formular -->
</div><!-- kommentare -->
Alles anzeigen
Hoffe, ihr habt einen Rat für mich.