• Resolved cheonmu

    (@cheonmu)


    hello.

    I want to add a class called daum-wm-content to the default entry-content class of the post.

    <div class="entry-content daum-wm-content">

    I tried adding some code as follows, but nothing works.

    function add_daum_wm_content_class($content) {
     // extend entry-content class to daum-wm-content class
     $content = str_replace('class="entry-content"', 'class="entry-content daum-wm-content"', $content);
     return $content;
    }
    
    // Use filter to apply to post content
    add_filter('the_content', 'add_daum_wm_content_class');

    Could you please let me know if there is a way to solve this problem?

    thank you.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Is there any way to add a class to .entry-content?’ is closed to new replies.