How to give each category name its own ACF background color?

The syntax to get the ACF field of a custom taxonomy is: $var = get_field(‘name_of_acf_field’, ‘name_of_taxonomy’ . ‘_’ . taxonomy_ID); so in your case you’ll need to get product_cat ID before and do something like: add_action( ‘woocommerce_shop_loop_item_title’, ‘VS_woo_loop_product_title’, 10 ); function VS_woo_loop_product_title() { echo ‘<h3>’ . get_the_title() . ‘</h3>’; $terms = get_the_terms( $post->ID, ‘product_cat’ ); … Read more

How can I force Dynamic CSS via ACF values to update on page load?

Per Tony’s suggestion, adding a random string to the CSS version did the trick. Here’s the code I used to do that. First this code to generate the random number. // get theme version function cd_get_version() { $theme_data = wp_get_theme(); return $theme_data->Version; } $theme_version = cd_get_version(); global $theme_version; // get random number function cd_get_random() { … Read more

URL through custom field returning null

Refer ACF link : Link And use <?php echo get_field(‘aboutus_img’); ?> Choose option image url This example demonstrates how to display the selected image when using the Image URL return type. This return type allows us to efficiently display a basic image but prevents us from loading any extra data about the image. <?php if( … Read more