I accidentally discovered today a great usability feature for WordPress blogs - ability to toggle display of comments with a simple click.
Usually when you have a lots of comments on a post the navigation is hindered as it is difficult to get to the footer of the site. Also when the user wants to give a comment directly in reference to the post, it makes it nearly impossible as they need to scroll up and down all the time.
The solution is following line of code that you can insert in your comment template. I have put mine just below the number of comments.
<a style="cursor:pointer" onclick="jQuery('#comments').toggle();">Toggle comments</a>
This assumes that you have jquery loaded (most sites do) and that your comments div is #comments. You can change to match your needs.
Go ahead try it out below.
- Optimize your WordPress page loading times with a simple tweak
- How to use custom page template in WordPress themes
- WordPress Fundamentals for Newbies
Posted in: WordPress
TAGS:comment toggle, jquery toggle all, jquery toggle comments, one line love comments, toggle code wordpress, toggle comment form, toggle comment wordpress, toggle comments, toggle comments blog, toggle text wordpress code, toggle themes, toggle wordpress code, togglr comments website, usa one liner comment, wordpress toggle, wordpress toggle comments