• Resolved rblz

    (@rblz)


    Hi,

    I try to add a youtube video in the description of WooCommerce Category page, but the code is removed.

    I try to fix it with differents codes, but nothing is working.

    It triied this https://woocommerce.com/document/allow-html-in-term-category-tag-descriptions/

    /**
     * Allow HTML in term (category, tag) descriptions
     */
    foreach ( array( 'pre_term_description' ) as $filter ) {
    	remove_filter( $filter, 'wp_filter_kses' );
    	if ( ! current_user_can( 'unfiltered_html' ) ) {
    		add_filter( $filter, 'wp_filter_post_kses' );
    	}
    }
     
    foreach ( array( 'term_description' ) as $filter ) {
    	remove_filter( $filter, 'wp_kses_data' );
    }

    Maybe this code is not for the woocommerce category page, but the category of wordpress.

    Do you have any idea how to remove the specific filter that remove html tags in the woocommerce category page?

    Any solutions ?

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi there @rblz ??

    Thank you for contacting Woo support!

    First, apologies for the delay. We have seen a recent influx of tickets and are currently working through a backlog.

    I try to add a youtube video in the description of WooCommerce Category page, but the code is removed.

    As I understand, you would like to add HTML in the category description at your site.

    The workaround provided in the thread linked here, needs the script from this documentation page, in order to work as expected.

    That code can be added via a plugin that allows custom functions to be added, such as the?Code snippets?plugin.

    My recommendation would be to add the URL, instead of the iFrame, as showcased in the screenshot below:

    Direct link to image: https://snipboard.io/zsNUEy.jpg

    I trust that points you in the right direction, but if you have more questions, let us know. We’re happy to help.

    Thread Starter rblz

    (@rblz)

    I have already try the code you linked, but it’s not working for Woocommerce categories. It might work only for wordpress category.

    Althrough, I try to only paste the link of the video and it works. But I can’t modify the <iframe> tag to add “loading=lazy” to improve performance.

    That’s why I’m looking for a solution ??

    Howdy @rblz

    I try to only paste the link of the video and it works. But I can’t modify the <iframe> tag to add “loading=lazy” to improve performance.

    That’s why I’m looking for a solution

    Thank you for reaching back, clarifying things further. I’m glad to hear that adding the video URL works.

    Kindly note that lazy loading resources for improving performance is outside the scope of support in this forum. I would recommend trying a web search for how to lazy load embedded youtube videos, where results like this page surface, instead.

    I hope that helps!

    • This reply was modified 1 year, 4 months ago by anastas10s. Reason: rephrase
    Thread Starter rblz

    (@rblz)

    Hi,

    I try to search for solutions before posting.

    In the page that you link, you need to modify the iframe code, but I can’t add iframe tag in the woocommerce category description. The iframe is removed when I submit it…

    Hi there @rblz ??

    In the page that you link, you need to modify the iframe code, but I can’t add iframe tag in the woocommerce category description.

    Correct, I missed that the page I linked to requires iframe editing.

    I’d like to loop to the original issue that needs solving. What is the goal you are trying to reach with enabling iframes in the category description?

    As I understand, it is a performance improvement. Are there custom category pages already set up? Can you share a link to one, as an example?

    We await for your response, in order to assist you further. Cheers!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to add iframe in the description of category page of woocommerce ?’ is closed to new replies.