Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    The comment form seems to be displayed properly on my end:
    https://i.wpne.ws/OynG

    Have you managed to solve the issue by yourself?

    Thread Starter Othello

    (@othello)

    Yes, I managed to make some changes and get it to work.

    However, as you can see on your screenshot, the avatar doesn’t display the picture I chose in the Jetpack comment module (in fact, it doesn’t display any picture at all!)

    Would you know how to fix this??

    Thanks

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    Jetpack only changes the behaviour of the comment form, and does not affect the look of the comment list.

    I would recommend that you dig into your theme’s comments.php file to try to understand the issue.
    You can check how default themes like Twenty Eleven or Twenty Twelve handle comment lists to get a good example.

    Thread Starter Othello

    (@othello)

    I have very limited coding knowledge, would you be king enough to have a quick look at my comments.php code here and see if you find the issue at first reading? ??

    Thank you!!

    <?php

    // Do not delete these lines
    if (!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;
    }
    ?>

    <!– You can start editing here. –>
    <div class=”three-fourth last”>

    <?php comment_form(); ?>

    <div class=”big-separator”></div>

    <?php if ( have_comments() ) : ?>

      <?php wp_list_comments(‘max_depth=3&callback=mytheme_comment’); ?>

    <?php else : // this is displayed if there are no comments so far ?>
    <?php if ( comments_open() ) : ?>
    <!– If comments are open, but there are no comments. –>
    <?php else : // comments are closed ?>
    <!– If comments are closed. –>
    <p class=”nocomments”>Comments are closed.</p>
    <?php endif; ?>
    <?php endif; ?>
    </div>
    <div class=”clear”></div>
    <?php if ( comments_open() ) : ?>

    <div id=”respond”>
    <div class=”span-16 last”>

    <div class=”dot-separator margin15″></div>
    <!— replace comment_form(); –>
    <?php paginate_comments_links(‘prev_text=<<&next_text=>>’); ?>
    <div class=”cancel-comment-reply”>
    <small><?php cancel_comment_reply_link(); ?></small>
    </div>

    <?php if ( get_option(‘comment_registration’) && !is_user_logged_in() ) : ?>
    <p>You must be “>logged in to post a comment.</p>
    <?php else : ?>

    <div class=”post_comment last” style=”
    display: none;
    “>

    <?php if ( is_user_logged_in() ) : ?>
    <p style=”margin-bottom:18px;”>Connecté en tant que /wp-admin/profile.php”><?php echo $user_identity; ?>. ” title=”Se déconnecter”>Se déconnecter »</p>
    <?php else : ?>
    <div class=”span-8 form”>
    <fieldset>

    </fieldset>
    </div>

    <div class=”span-8 form last”>
    <fieldset>

    </fieldset>
    </div>
    <?php endif; ?>

    <p><?php comment_id_fields(); ?></p>
    <?php do_action(‘comment_form’, $post->ID); ?>
    </div>
    </form>

    <?php endif; // If registration required and not logged in ?>
    </div>
    </div>

    <?php endif; // if you delete this the sky will fall on your head ?>

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    <?php wp_list_comments('max_depth=3&callback=mytheme_comment'); ?>

    As you can see, your theme refers to a function named mytheme_comment to display the comments.

    I would recommend that you check how this function is built (you will find it in your theme’s functions.php file), and compare it with how Twenty Twelve Comment function is built:
    https://core.trac.www.ads-software.com/browser/trunk/wp-content/themes/twentytwelve/functions.php#L292

    Thread Starter Othello

    (@othello)

    In my functions.php file, the mytheme_comment function looks like that:

    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(); ?>” class=”seppp”>
    <?php if ($comment->comment_approved == ‘0’) : ?>
    <?php echo ‘Your comment is awaiting moderation.’; ?>
    <?php endif; ?>
    <!– <h3 class=”no-indent”><?php comment_author_link(); ?></h3> –>
    <div class=”comment”>
    <div class=”span-16 last partners notopmargin clients”>
    <div class=”span-3 notopmargin”>
    <div class=”bordered_img”>
    <?php echo get_avatar($comment,$size=’70’,$default='<path_to_url>’); ?>
    <h6 class=”colored” style=”margin-bottom:0px;”><?php comment_author_link(); ?></h6>
    <p class=”small nobottommargin”>Date: comment_ID ) ) ?>”><?php echo get_comment_date(‘M d’) ?></p>
    </div>
    </div>
    <div class=”span-13 notopmargin last”>
    <div class=”testimonial span-13 last”>
    <?php comment_text() ?>
    </div>
    </div>
    </div>
    </div>
    <div class=”span-16 separator_dash”></div>
    <div class=”clear”></div>
    </div>
    <?php
    }

    But then I don’t really know what the difference is with the twenty eleven comment function that could explain the avatar is not working :/

    Hello @othello, you have marked this Support thread as resolved. That is great news.

    Would you be able to post your solution here for others to read. This would help those who might be experiencing the same problem as you.

    Kind and warm regards

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    <?php echo get_avatar($comment,$size='70',$default='<path_to_url>'); ?>

    path_to_urlprobably won’t work. It would need to be a proper URL for the default avatar to be displayed properly.

    You do not actually need to specify a default image, this field is optional:
    https://codex.www.ads-software.com/Function_Reference/get_avatar

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Jetpack comment box doesn't display well’ is closed to new replies.