• Resolved 3Lancer

    (@3lancer)


    Hi,

    How can I prevent the Woocommerce ‘Store’ page from adding random p tags for shortcodes, images and links? It’s extremely annoying and creates a bunch of blank spaces around the place.

    I already have under my theme’s ‘Functions.php’ file:

    remove_filter( 'the_content', 'wpautop' );
    remove_filter( 'the_excerpt', 'wpautop' );
    remove_filter( 'comment_text', 'wpautop', 30 );

    However, Woocommerce ignores this. I’m trying to write HTML code under WordPress itself on top of the store page (to be displayed before Woocommerce lists it’s products).

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter 3Lancer

    (@3lancer)

    Update: It’s an issue with this WooCommerce call doing it…
    do_action( 'woocommerce_archive_description' );

    Under ‘archive-product.php’ template in the ‘<header class=”woocommerce-products-header”>’ code.

    Thread Starter 3Lancer

    (@3lancer)

    Update: Root cause…
    wc_format_content( $shop_page->post_content );

    Can resolve if instead using…
    do_shortcode( $shop_page->post_content );

    or better yet adding to ‘functions.php’…
    remove_filter( 'woocommerce_short_description', 'wpautop' );

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Random adding of empty P tags’ is closed to new replies.