Viewing 3 replies - 1 through 3 (of 3 total)
  • By default WC doesn′t seems to support “Read more” tag in product description. I almost finished a workaround for that limitation. I add in function.php of storefront-child theme (in my case) this undocumented pluggable WC function:

    function woocommerce_product_description_tab() {
        global $post;
        $heading = esc_html( apply_filters( 'woocommerce_product_description_heading', __( 'Product Description', 'woocommerce' ) ) );
        if ( $heading ):
          echo "<h2>$heading</h2>";
        endif;
    
        global $more;
        $more = 0;
    
        the_content(__('(more...)'));
    }

    But still have a problem, content below “more” got stripped (not even in source code) and still don′t know why?

    Using WP4.1.1. + WC2.3.5

    I realized that the_content function (which WC also uses) doesn’t allow “Read more” to work if it’s outside the loop. I resolved it using an spoiler plugin to partially hide content.

    Thread Starter soufianenz

    (@soufianenz)

    I have been searching and found this which is very useful for me:

    <details>
    <summary>read more…</summary>
    <p>If your browser supports this element, it should allow you to expand and collapse these details.</p></details>

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘"Read More" for long product desriptions’ is closed to new replies.