0

I have a question and answer website and using a custom wordpress theme, which has the option to enable read more link using jquery. When i click on read more link, it expands full content of the post without opening the post.

I want to know if it is possible to expand the post by default without clicking on red more link. Could you please help me to achieve this.

enter image description here

1 Answer 1

0

You can use the solution bellow with jQuery:

jQuery(document).ready(function(){
        jQuery(".post-read-more").each(function(){
            jQuery(this).click();
        });
        // And if you want to finally disable this links
        jQuery(".question-read-more").remove();
        jQuery(".question-read-less").remove();
    });

Bests, Camille

1
  • Thanks for the help. May i know where and how exactly i need to add this code. I have no prior experience of modifying jQuery. I see a folder called JS for java script inside theme and there are several files. Sorry for basic question. Commented Apr 2, 2020 at 15:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.