Support

Account

Home Forums Bug Reports ACF block does not work with wc_get_template_part

Solving

ACF block does not work with wc_get_template_part

  • Hello,

    I created a block to display WooCommerce product list and I loaded the product template file with wc_get_template_part().

    It was working fine, but after updating ACF Pro to version 5.11, the block stops showing the product list in editor (on front-end it works fine). In editor the block is empty.

    When I downgrade ACF Pro to 5.10.2, it works fine again.

    Can someone help me?

  • Hey @kezily

    Could you drop us an email to support@advancedcustomfields.com with a copy of your block registration and template code so we can try to reproduce this?

    Thanks!

  • Hi @lgladdy,

    I sent an email to support.

    Thank you.

  • What if you try:
    <?php include( locate_template( 'includes/loop.php', false, false ) ); ?>

    Just change the directory from includes to what you need and loop.php to the name of your file.

    Does that work for you?

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.