WooCommerce: expiring date for products (and on sale some days before)
WooCommerce: expiring date for products (and on sale some days before)
WooCommerce: expiring date for products (and on sale some days before)
ACF – not able to loop through flexible content field which is inside a group field
ACF has a built in filter for their flexible rows which you may be able to leverage/adjust for your own use on your repeater, or investigate and build your own: apply_filters( ‘acf/fields/flexible_content/layout_title’, $title, $field, $layout, $i ); Their documentation covers this here: https://www.advancedcustomfields.com/resources/acf-fields-flexible_content-layout_title/
Put ACF function output code the_terms
How to get ACF field to show up on all posts on front end?
ACF Create Array of All Woocommerce Product IDs with a Checkbox ticked
I think you may check the Advanced Configuration of your CPT in ACF settings. There is an option to disable the View button in tab URLs called Publicly Queryable if it’s disabled. Publicly Queryable: disable Publicly Queryable: enable
Based on https://stackoverflow.com/questions/42011047/wordpress-query-by-acf-relationship-field, I was able to fix this by changing the ‘compare’ => ‘IN’ to ‘compare’ => ‘LIKE’. So the resultant code looks like this: $new_query_args = [ ‘meta_query’ => [ [ ‘key’ => ‘af_author’, ‘value’ => get_the_ID(), ‘compare’ => ‘LIKE’, ] ] ]; $query_args = array_merge( $query_args, $new_query_args ); I’m not exactly sure … Read more
According to ACF documentation, a foreach loop is to be used to access the items in a Relationship field. Untested: $templates = get_field( ‘field_61318c078a746’ ); foreach ( $templates as $template ) { $template_image_id = absint( get_field( ‘Image’, $template ) ); $template_image_url=”https://example.com/fallback-image.jpg”; if ( ! empty( $template_image_id ) ) { $template_image_url = wp_get_attachment_image_url( $template_image_id, ‘large’ ); … Read more
ACF official documentation indicates it should be as simple as using have_rows() again: if ( have_rows( ‘field_1’ ) ) { while ( have_rows( ‘field_1 ‘ ) ) { the_row(); if ( have_rows( ‘field_2’ ) ) { while ( have_rows( ‘field_2’ ) ) { the_row(); $value = get_sub_field( … ); } } } } Note that … Read more