marwinvdv
Forum Replies Created
-
Hello Dcoony,
Thank you for the quick and helpfull response!
Adding thedelegate
did the trick, it works now perfectly.Thanks!
I figured out what is the problem, I forgot to add:
<?php wp_footer(); ?>
to my footer.php theme….Problem solved, it is working great! 🙂
I added a callback in functions.php
function hmc_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>"> <div class="commentbox clearfix"> <div class="commentavatar floatleft"> <?php $urlHome = get_option('home'); echo get_avatar( $comment, $size='50', $default = $urlHome . '/wp-content/themes/hmc/images/avatar.png' ); ?> </div> <div class="commentcontent floatleft"> <div class="commentheading clearfix"> <h2 class="floatleft"><?php comment_author_link(); ?></h2> <p class="floatright"><?php echo human_time_diff( get_comment_time('U'), current_time('timestamp') ) . ' ago'; ?></p> </div> <?php comment_text(); ?> </div> </div> <?php }
And just this is the comment.php
<ol class="commentlist"> <?php wp_list_comments('type=comment&callback=hmc_comment'); ?> </ol>
In the admin area I put hmc_comment in “Callback function name”.
But it doesn’t work. When I submit a comment it loads /wp-comments-post.php as page and I see only the submitted comment (with markup form the functions.php).When I used this in the functions.php in the Twenty Ten theme (override the default twentyten_comment callback function) and the comments.php it works (so it used hmc_comment as callback function).
It is realy strange that it isn’t working in my own theme. I know I do something wrong, but I can’t figure out what I’m doing wrong…
I see now that TacoCode is also the author of this plugin, really nice of you to make this plugin and also help people (like a noob like me) on the forum!
Thanks TacoCode for your reply!
I search on the codex and found this: Function Reference/wp list comments. So it seems not to hard to adapt the callback function 🙂I found a different in the textarea output between the two themes with the same comments.php.
In my own theme this is the output for the textarea:
<textarea name="comment" id="comment" class="commentinput inputstylebox"></textarea>
But in the Twenty Ten theme this is the output for the textarea:
<textarea name="comment" id="comment" class="commentinput inputstylebox" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(238, 238, 238); background-position: initial initial; background-repeat: initial initial; "></textarea>
The plugin adjust the textarea in the Twenty Ten theme, but not in my own theme.