• Resolved Chitauri

    (@chitauri)


    I´ve read this post to add pages comments in wordpress without plugins, but I have doubts.

    “Open your comments.php template file and add the following line where you want the comment pagination to appear.
    Note: If you are currently using the previous_comments_link and next_comments_link functions, you may want to replace them with the pagination.”

    <div class="pagination">
        <?php paginate_comments_links(); ?>
    </div>

    Where is previous_comments_link and next_comments_link functions that I have to replace for the above code?

    My website is:

    http://www.falsalibertad.com/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Where is previous_comments_link and next_comments_link functions

    <?php paginate_comments_links(); ?>

    Thread Starter Chitauri

    (@chitauri)

    Here is the html comments code:

    <?php
    			previous_comments_link(  '<span class="meta-nav">←</span>'. esc_html__( 'Older Comments', 'Raindrops' ) );
    ?>
    			</span>
        		<span class="nav-next">
    <?php
    			next_comments_link(  esc_html__( 'Newer Comments', 'Raindrops' ). '<span class="meta-nav">→</span>' );
    ?>
    			</span>
    		</div>
    <?php

    Have I to replace all by:

    <div class="pagination">
        <?php paginate_comments_links(); ?>
    </div>

    Do not edit the theme itself. First create a child theme for your changes.

    Thread Starter Chitauri

    (@chitauri)

    I´ve installed the code succesfully, the code i have to remplace was this:

    <?php
    		if ( get_comment_pages_count( ) > 1 && get_option( 'page_comments' ) ){ // Are there comments to navigate through?
    ?>
    		<div id="nav-below-comments" class="clearfix">
    			<span class="nav-previous">
    <?php
    			previous_comments_link(  '<span class="meta-nav">&larr;</span> '. esc_html__( 'Older Comments', 'Raindrops' ) );
    ?>
    			</span>
        		<span class="nav-next">
    <?php
    			next_comments_link( esc_html__( 'Newer Comments ', 'Raindrops' ). '<span class="meta-nav">&rarr;</span>' );
    ?>
    			</span>
    		</div>
    <?php
           } // check for comment navigation
    ?>

    I replaced for this:

    <div class="pagination">
        <?php paginate_comments_links(); ?>
    </div>

    Now It works perfectly

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘How to add wordpress pages comments without a plugin?’ is closed to new replies.