Hi Simran,
you can achive this without widget as well if you know css & js, just put your text into a container and give class "text-container" and give text the class "text-content" and create a button wih class "show-more-btn" with buttoncaption "Show More"
use below styling it will initially show 3 lines as line-clamp is 3
.text-container { position: relative;}
.text-content { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;}
.text-content.expanded { display: block; overflow: visible;}
use below java script
setTimeout(function() { const showMoreBtn = document.querySelector(".show-more-btn"); const textContent = document.querySelector(".text-content");
showMoreBtn.addEventListener("click", function() { textContent.classList.toggle("expanded"); const isExpanded = textContent.classList.contains("expanded"); showMoreBtn.textContent = isExpanded ? "Show Less" : "Show More"; showMoreBtn.classList.toggle("less", isExpanded); });}, 1000);
Hope it helps!