• Resolved btom76

    (@btom76)


    Hello,
    I want to add a YouTube video in the description of a product category, via an iframe.
    However, during recording, the iframe disappears and is not taken into account.
    How to allow permission of the YouTube iframe in the product category description?
    Thank you in advance

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Stuart Duff – a11n

    (@stuartduff)

    Automattic Happiness Engineer

    Hi @btom76,

    You can add a YouTube video link to the WooCommerce product category description and the video will display on the category. Below is a screenshot taken from a test site which has the latest version of WordPress, WooCommerce and the free Storefront theme enabled.

    Category Description

    Image Link: https://cloudup.com/cTRsYXIkk0i

    Category Display

    Image Link: https://cloudup.com/cHLKF-p845f

    Thread Starter btom76

    (@btom76)

    Hello,
    Thank you for your reply. Indeed, by putting the link of the video directly, it works.
    However, my wish is to directly integrate an <iframe> from the YouTube video (for CSS style, and for better integration into my HTML code). Indeed, the <iframe> disappears from the category description when I save the changes.
    Is there a possibility of integrating the <iframe> in the product category?
    Thank you

    Plugin Support Stuart Duff – a11n

    (@stuartduff)

    Automattic Happiness Engineer

    Hi @btom76,

    By default, the WooCommerce product category description field would not support iFrames and strip the content out when those were added. Adding this code below to a themes functions.php file will allow HTML content in WordPress category descriptions.

    https://docs.woocommerce.com/document/allow-html-in-term-category-tag-descriptions/

    I tested this with an iframe video in a product category description and it works.

    <iframe width="420" height="315" src="https://www.youtube.com/embed/tgbNymZ7vqY"></iframe>

    Image Link: https://cloudup.com/c59mR-ynimW

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display a YouTube video in the category description’ is closed to new replies.