Reply 345958 to: Swatch image thumbnail size ratio + product filters

Avatar: Rose Tyler
Rose Tyler
Support staff
February 3, 2023 at 13:18

Hello, Enjin

Thanks for details!
As we found in next article -> https://support.advancedcustomfields.com/forums/topic/get-custom-taxonomy-field-value/
Support it may be needed sometimes to change get_field('field_name') with next structure get_field('titre', $taxonomy . '_' .$term_id)
We changed the code in your functions.php and here it is ->

if ( ! function_exists( 'etheme_second_cat_desc' ) ) {
    function etheme_second_cat_desc() {
      global $wp_query;
      $cat = $wp_query->get_queried_object();

      $desc = '';
      if ( property_exists( $cat, 'term_id' ) && ! is_search() ) {
        /* My ACF */
        $titre_bas = get_field('titre', $cat->taxonomy . '_' .$cat->term_id);
        $sous_titre = get_field('sous-titre', $cat->taxonomy . '_' .$cat->term_id);
        $img_bas = get_field('image_sous_produits', $cat->taxonomy . '_' .$cat->term_id);
        $desc = get_term_meta( $cat->term_id, '_et_second_description', true );
      } else {
        return;
      }

      if ( ! empty( $desc ) ) {
        echo '<div class="bloc_bas"><div class="term-description et_second-description test">' . $titre_bas . $sous_titre . do_shortcode( $desc ) . '</div><div class="banner-bas" style="background-image: url('.$img_bas.');"></div></div>';
      }
    }
  }

Code file -> https://prnt.sc/kDdiLW8fobWs
Backend -> https://prnt.sc/9djdbpMNz542
Frontend -> https://prnt.sc/Kcn2yBy0CYsh
We hope you find the code snippet above useful and you are satisfied with the result!

Kind Regards,
8theme team

Go To The Whole Conversation In Topic
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.