@bulldogsnare As I can understand, you have created a date field for the product category taxonomy and you want to display it in your product category archives. Here is one approach to do that –
function tax_date_field(){
// get the current taxonomy term
$term = get_queried_object();
//ACF field
$date = get_field('class_dates', $term);
$class_date = '';
if( is_tax('product_cat') && $date ) {
$class_date = sprintf(
'<div class="class-date"><label>%s</label>%s</div>',
esc_html__('Post Dates:', 'your-themes-text-domain'),
esc_html( $date )
);
}
return $class_date;
}
Now you can echo the function to your product category archives. To do that, WooCommerce have some hooks for the taxonomy archive page which you can find inside archive-product.php
template file inside WooCommerce plugin folder.
Here I am hooking it to woocommerce_before_shop_loop
. In your functions.php –
add_action('woocommerce_before_shop_loop', 'show_post_dates', 11);
function show_post_dates(){
echo tax_date_field();
}
Now the field will be shown at product taxonomy archives. Let me know if you have any questions.
You can check the acf/load_field
filter once. It can update field’s feed dynamically.
This is because dynamic blocks require ajax calls to integrate in Gutenberg editor. This topic is discussed in detail here –
Multiple ACF blocks Failed to load resource: the server responded with a status of 503
I am only facing this issue at live server and not in wamp localhost. Actually the ACF blocks are using admin-ajax.js to load preview html as well as edit. This is causing more trouble. For every block preview (for fresh load or in editing), there is a request. I don’t know if this will be solved by ACF or not…
However, the native WP blocks are not using admin-ajax.js rather using react.js
Have you found any solution to this yet?
There is no need to hack the core indeed. Here is how to achieve this –
https://support.advancedcustomfields.com/forums/topic/how-to-wrap-field-groups/#post-41536
Perfecto!! That is what I am doing actually. But this returns the duplicate hidden fields –
<div class="acf-hidden" id="acf-form-data">
<div class="acf-hidden">
These two divs are getting duplicated with each form group. But I never find any trouble with it though. However I am trying to delete duplicate hidden divs with jQuery. Something like this –
var $div = jQuery('form div.acf-hidden');
if ($div.length > 1) {
$div.slice(2, 100).remove();
}
The above solution allows me to create a multi-step form with custom styling and effects.
Is it possible to have a multi step form in front end to create a custom post with ACF?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.