Skip to content

Instantly share code, notes, and snippets.

@rodica-andronache
Last active December 17, 2015 21:49
Show Gist options
  • Save rodica-andronache/5677660 to your computer and use it in GitHub Desktop.
Save rodica-andronache/5677660 to your computer and use it in GitHub Desktop.
WORDPRESS - Afisare comentarii post
In comments.php:
<ul>
<?php
wp_list_comments('type=comment&callback=mytheme_comment');
?>
</ul>
In functions.php:
function mytheme_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; ?>
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
<div id="comment-<?php comment_ID(); ?>">
<div class="comment-author vcard">
<?php $d = "d M Y"; ?>
<?php printf(__('<cite class="commenttitle">%1$s <span>//%2$s</span></cite>'), get_comment_author_link(), get_comment_date($d)) ?>
</div>
<?php if ($comment->comment_approved == '0') : ?>
<em><?php _e('Your comment is awaiting moderation.', 'vertiMagazine') ?></em>
<br />
<?php endif; ?>
<?php comment_text() ?>
</div>
<?php
}
Unde vreau sa afisez:
<?php comments_template(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment