Viewing 8 replies - 1 through 8 (of 8 total)
  • Leo

    (@leohsiang)

    Hi there,

    Is there a specific part you are referring to?

    Please be mindful that we cannot provide a full custom solution in the forum here but I’ll try to point you in the right direction.

    Thread Starter parkinternet

    (@parkinternet)

    Ok sir no problem !! , Can you please provide me the code of how can i change the alignment? It means how to add comment policy below the title and and alignment of placeholder box like given here – https://kinsta.com/blog/rank-math-vs-yoast

    Elvin

    (@ejcabquina)

    Hi there,

    You can add a comment policy by using the generate_below_comments_title hook.

    Example:

    add_action('generate_below_comments_title',function(){
    echo '<p class="comment-policy"><strong>Comment policy:</strong> We love comments and appreciate the time that readers spend to share ideas and give feedback. However, all comments are manually moderated and those deemed to be spam or solely promotional will be deleted.</div>';
    });

    As for the specific styling of the box(shadow, padding, etc):

    Try this:

    div#respond {
        display: block;
        padding: 40px;
        background: #fff;
        background-size: cover;
        background-repeat: no-repeat;
        background-position: 50%;
        box-shadow: 0 10px 40px 0 rgb(47 47 47 / 10%);
        position: relative;
        transition: all .2s linear;
    }

    The alignment is WordPress default.(text-align:left;)

    Thread Starter parkinternet

    (@parkinternet)

    Thanks @ejcabquina but i want to move the comment policy text below leave a reply

    Elvin

    (@ejcabquina)

    There’s no hook within the comment box directly below the leave a reply, unfortunately.

    But you can try filtering the default WordPress comment template by doing this:

    function wpdocs_comment_form_defaults( $defaults ) {
      $defaults['title_reply_after'] = '</h3><p class="comment-policy"><strong>Comment policy:</strong> We love comments and appreciate the time that readers spend to share ideas and give feedback. However, all comments are manually moderated and those deemed to be spam or solely promotional will be deleted.</p>';
      return $defaults;
    }
    add_filter( 'comment_form_defaults', 'wpdocs_comment_form_defaults' );
    Thread Starter parkinternet

    (@parkinternet)

    Thanks @ejcabquina it’s worked, one last help can we add a button after “Leave a reply” like this https://prnt.sc/ya6ba9 . Such that users can easily navigate through it. Please Sir Last help

    Leo

    (@leohsiang)

    That one would be more difficult unfortunately – you will need to modify the default WordPress comment template itself.

    Thread Starter parkinternet

    (@parkinternet)

    Ok thanks for your free help, now it’s time to close the support forum !!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Comment Layout’ is closed to new replies.