I have a solution to this, at least in my specific case.
Solution
get_template_part()
did work in the end, but ACF needed the ID of the post (the Shop page). When calling ACF fields from outside of the loop you need to specify a post ID.
For all of the other pages on the site where the template is being used, it knew the ID already so I didn’t have to specify. Seemingly, where I was calling it from in archive-product.php was outside of the loop. If someone could clarify that, it may be helpful.
So, in archive-product.php:
<?php get_template_part( 'partials/acf', 'a-template-file' ); ?>
Then in the template file:
$post_id = '';
if ( is_shop() ) {
$post_id = 20; // 20 being the ID of my Shop page
} else {
$post_id = get_the_ID();
}
if ( have_rows('flexible_content_layout', $post_id) ) {
while ( have_rows('flexible_content_layout', $post_id) ) {
the_row();
// etc, etc...
Related Posts:
- Redirect to another page using contact form 7? [closed]
- Advanced Custom Fields (acf) – Filter Relationship by Taxonomies not Post Type
- ACF Fields are not showing up on Homepage
- How ACF Advanced Custom Field works with Woocommerce Single Product [closed]
- Update acf field in woocommerce orders
- Hide prices and checkout functionality in woocommerce
- How to Display Product specific to a category with WooCommerce Plugin? [closed]
- Woocommerce hook after creating order? [closed]
- Function to Set Product type in Woocommerce [closed]
- Visual Composer vs. Advanced Custom Fields [closed]
- Add CSS class to add-to-cart button, Woocommerce [closed]
- Remove action from woocommerce barcode plugin [closed]
- Advanced Custom Fields query
- Woocommerce Shipping module available only for type of products [closed]
- WooCommerce – Adding Custom Order Without No Product [closed]
- XML sitemap over product variations
- Manually add order item with fixed product_id in WooCommerce
- How can I display a contact form for out of stock products in WooCommerce?
- WooCommerce shop page orderby [closed]
- woocommerce 3.2.1 not sending order notification emails
- WooCommerce Custom Product to checkout
- How to stop activating a plugin and show admin notice when dependent plugins minimum version is not met
- How to enable specific plugin only based around shop manager role?
- WordPress automatically removes line break
- Why required field not working in Country dropdown in WooCommerce –
- Add woocommerce variation images in gallery?
- Fetch Children of Grouped Products Inside WooCommerce Product Loop
- How to check current user before all actions and filters?
- I want to disable Cash on delivery based on product tag in woocommerce Checkout Page [closed]
- Is there a way to create custom product templates based on category on WooCommerce?
- WooCommerce specifc variations for specific user role [closed]
- Can you use another Profile Builder shortcodes through advanced custom fields
- Woocommerce Shop page variation product button replace with add to cart button
- How to get a list of bundled products using wp_query in woocommerce
- Slashes stripped in ACF
- Keeping and updating ACF and ACF Pro at the same time
- How to get the particular product quantity in orders in Woocommerce [closed]
- Woocommerce Backend Search by Title and SKU
- WooCommerce Shopping Cart Not Initially Showing Products [closed]
- Override a Plugin Function
- Custom template for all woo commerce categories
- Is it possible to instantiate a new WC_Cart?
- Sell access to form [closed]
- Add key and value to an array in another file
- I want to filter my products with attributes [closed]
- Advanced Custom Fields Plugin – Images not displaying
- Automatic recurring payment using YITH subscription and Dokan Stripe
- How to validate custom fields in Quick edit/bulk edit?
- apply_filters(woocommerce_get_item_data, …) Causing errors when adding to cart
- What snippet do I need to type to show my ACF field show up on my theme?
- Change Dashboard URL from wp-admin to wp-admin/index.php
- How To Use do_shortcode with WooCommerce One Page Checkout
- How to makes changes on the shop/category/tag pages but not on the product pages in woocommerce?
- Hide fields in woocommerce settings
- Can’t load the the canges of field groups [duplicate]
- woocommerce: Customize email with item total count
- Save order without sending the invoice / order details woocommerce [closed]
- show wc_add notices on particular page in woo commerce custom plugin development
- Woocommerce redirection if no previous orders
- Make modification of add_to_cart button specific to single page
- How to get the checkout form data from checkout page when place-order button is clicked
- Product Page loads terribly slow when product gallery images are added
- How to make WooCommerce multiple filter with custom meta fields
- One WooCommerce Store to multi distributor sites
- Custom form data not displaying in cart page?
- best way to handle subscriptions with a licence?
- Is there a request for products plugin for WooCommerce
- Checkbox field that add a subscription product and change prices of other products in checkout and cart page
- woocommerce with external ftp site
- Only return taxonomies that are linked to a category & product
- WordPress eMails not working
- Add WooCommerce vendor slug to auto-generated SKU
- Custom plugin issue – Notice: Trying to get property of non-object in
- fetch price from different table woocommerce
- Cannot save a custom meta field in quick edit
- how to make settings page for woocommerce plugin?
- redirect to a custom page
- wordpress plugin translation not working
- ACF Query result in a new td (echo)
- Else If statement for ACF [closed]
- Change value of Points earned in product data
- Problem with conditional woocommerce custom checkout field
- How woo-commerce store Product Data value in DB?
- Not getting result using ajax on wordpress
- woocommerce blank page after clicking add to cart [closed]
- Which WordPress version to use for improved plugin compatibility? [closed]
- Hide/Show panel not showing – ACF
- Woocommerce Bookings – Resource needs to be allocated for part of the booking duration, not the whole booking
- Trying to disable all notifications except for one on woocommerce checkout page with css [closed]
- Woocommerce – Product Description heading [closed]
- Visual Composer Data Source?
- Woocommerce where to set the Price Suffix [closed]
- Is there a method or plugin to download my products in WooCommerce?
- Translate text for empty product
- how to add meta for order in woocommerce
- True/False ACF field returning null by default even if default value is true
- WooCommerce REST API aborts connection [closed]
- Product customizing quiz – quiz adding products to the cart
- ACF prugin for WooCommerce Shop Page
- How to create different woocommerce single_product.php pages for each product? [closed]