• Resolved mttindustries

    (@mttindustries-1)


    Hi, I’m developing a theme for my woocomerce site and I’ve noticed an interesting bug. On the single-product.php page if i use the<?php wc_get_template_part( 'content', 'single-product' ); ?> code all the content duplicates itself, but if I use the standard the_contentcode then it’s fine however it rendered these extra divs I don’t won’t. I much prefer to do it with <?php wc_get_template_part( 'content', 'single-product' ); ?> I have gotten it to work in the past with other sites but this time it’s duplicating everything

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support RK a11n

    (@riaanknoetze)

    Hi there,

    This is an in-depth development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the following places for more development-oriented questions:

    1. WooCommerce Slack Community: https://woocommerce.com/community-slack/
    2. Advanced WooCommerce group on Facebook: https://www.facebook.com/groups/advanced.woocommerce/
    Thread Starter mttindustries

    (@mttindustries-1)

    I ended up figuring it out. afterwards I realised I’ve encountered this on another template development. I think it’s a bug on woocommerce. The culprit was the description.php file under the tabs directory. Defaultly it’s pulling the content with the_content(); – and so this runs into so many problems with templating. It obviously clashes when on custom templates you’re using the get template part function. So I replaced the content code on the desciption.php file with echo wpautop( $post->post_content );. It’s much more stable.

    • This reply was modified 4 years, 6 months ago by mttindustries.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘single page content duplicates’ is closed to new replies.