Site logo

[Support request] Reloading current page when clicking comment link (custom post)

Home Forums Support [Support request] Reloading current page when clicking comment link (custom post)

Home Forums Support Reloading current page when clicking comment link (custom post)

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2447650
    Masud

    I’ve added comment link in custom post type using this tutorial.

    <div id="showcomments">		
    <i class="fa fa-comments-o" aria-hidden="true"></i>
     <?php comments_popup_link( __( 'Comment', 'generatepress' ), __( '1 Comment', 'generatepress' ), __( '% Comments', 'generatepress' ) ); ?> 		
    </div>
    
     <div id='cp-comment-area' class="cp-comment-link">
    	<?php comments_template (); ?>
    </div>

    But the problem is, when I click on that link, it’s reloading current page.
    When there is no comment, that link contains #respond at the end of the url

    <a href="https://maysite.com/custompost/post1#respond">Comment</a>

    When there are comments, that link contains #comments at the end of the url

    <a href="https://maysite.com/custompost/post2#comments">Comment</a>

    And for both cases reloading the page.

    I can see there is no slash / before # in both cases.

    #2448348
    Ying
    Staff
    Customer Support

    Hi there,

    I just tested the code, it’s working properly.

    Can you disable all plugins and custom functions to test?

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.