最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to enable read more by default using jquery

programmeradmin3浏览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.

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.

Share Improve this question asked Apr 2, 2020 at 5:25 Avinash PatelAvinash Patel 398 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 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

发布评论

评论列表(0)

  1. 暂无评论