WordPress Plugin – Read more Read less

Published by Shashank Kumar on

While working on a WordPress site, a few days ago I had a condition where I needed to show some part of a paragraph followed by Read more/less button which shows/hides the para content accordingly. Then something came into my mind and I made a plugin. My very first plugin :).

Its a so easy and lightweight plugin that helps you to show some portion of large data and show/hide on a button click. Also if there is any URL in that link, it will redirect you there. Place this code in your template file, post, page content <label class=”redirectTo” style=”display: none”>, here you can provide the link where you want to redirect the page and its optional. If its empty then read more read less functionality will work.</label> and in between the tag set the URL you want to redirect the user and use this shortcode to “[ readmoreless maxchar=50]Here you can put your string[ /readmoreless]” to show the data and in between the tag set the string you want to show. maxchar is the variable where you set the maximum words you want to show when the page loads.

You can download the plugin from WordPress Official Site, after the installation you can use it directly without any problem as explained above. In the next para, you can see a working example of what I am trying to explain. You can also see the image down below, there I have shown how/where to use the tag. 

What is Lorem Ipsum?

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry’s standard dummy text eversince the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Read More...  Read Less...

For any question/query regarding the plugin, you can either make a comment down below or contact me. I will get back to you as soon as I can.

Thank You
Shashank Kumar
Email ID= Shashankkumar427@gmail.com


0 Comments

Leave a Reply