Comment's Pagination help you to load your site if there are a lot of comment in any blog post. There are many Wordpress plugin to do this. But sometimes it don't shows what you want. But now I am shearing a tricks to do this without any plugin.
Lets start..
LogIn to your account and go to comments.php
Now find this default code below:
<div
class
=
"alignleft"
><?php previous_comments_link() ?></div>
<div
class
=
"alignright"
><?php next_comments_link() ?></div>
Place this code after this:
N.B: If you don't find default code then place above commentlist code.<div
class
=
"paginate"
>
<?php
//Create pagination links for the comments on the current post
paginate_comments_links(
array
(
'prev_text'
=>
'‹ New comment'
,
'next_text'
=>
'Old comment ›'
));
?>
</div>
Generally "commentlist" code is like:
Now place this code in style.css :<ol
class
=
"commentlist"
>
<?php wp_list_comments(
'avatar_size=64&style=ol'
); ?>
</ol>
Now go to Dashboard > Settings > Discussion Settings.paginate {
margin: 10px 0 20px 0;
padding: 5px 1px 5px;
text-align: center;
font-family: Arial, Helvetica, sans-serif, SolaimanLipi;
}
.paginate a {
padding: 3px 6px 4px 6px;
margin: 3px;
text-decoration: none;
border: 1px solid #ccc;
color: #666;
background-color: inherit;
font-family: Arial, Helvetica, sans-serif, SolaimanLipi;
}
.paginate a:hover {
border: 1px solid #444;
color: #444;
background-color: #eee;
}
.paginate .current {
padding: 3px 6px 4px 6px;
margin: 3px;
font-weight:bold;
border: 1px solid #666;
color: #444;
background-color: #eee;
}
Then chose the value of Break comments into pages with top level comments per page and the page displayed by default as you like.
[Please comment for any Problem]
No comments:
Post a Comment
!! COMMENT HERE FOR ANY PROBLEM !!