Support

Account

Home Forums Search Search Results for 'taxonomy'

Search Results for 'taxonomy'

topic

  • Unread

    Need Some Guidance

    Hi there

    I’ve created a custom post type “Books” Below that I’ve added a Taxonomy “Books” as well. Now on the Add New Book page i am unable to display “Biology” that is a Child Taxonomy. I’ve already added “Biology” at taxonomy page.

    How can i display this on my edit / add book page?

    Regards

  • Solving

    ACF taxonomy and url rewrite

    I created a custom post type ‘products’ using ACF.

    Then, I created the taxonomy ‘product categories’.

    Now, when I click ‘view’ on one of these taxonomies like ‘t-shirts’,

    I end up on this URL: ‘/product-category/t-shirts/’

    I would like my URL to be: ‘/products/t-shirts/’

    So, I tried going to the URL section of the taxonomy select ‘permalink rewrite’ and entered ‘products/’ in the URL slug.

    Now, when I click ‘view’ on ‘t-shirts’, I end up on this URL: ‘/products/t-shirts/’, which is correct, but the page is a 404.

    Am I missing a step?

  • Unread

    Display Taxonomy name

    Hello,

    I’m working on a website with a search bar based on 2 taxonomies, City and Project. From the search bar the user selects a ‘City’ first and then the ‘Project’ dropdown updates based on the companies available in the initial city selected. Once the user click ‘search’, the website redirects them to a result page where all the companies shown are based on the previous selection.

    I need to show on this page a title with the taxonomy name selected for the ‘city’ on top of the page. I have created the taxonomy and gave a key name ‘city_acf’. Is there anyone kind enough to help me sort this?

    Thank you so much in advance.

    Matt

  • Unread

    Getting value of a custom field in a custom taxonomy

    Hi,
    I have created a custom post type “Stories” where I’ve also created a custom taxonomy named “Segment”. Connected to this custom taxonomy I’ve created a custom field “segment_image” (set to array) ruled to be shown if Taxonomy is equal to “Segment”. The idea is that each term will have an image assigned and will be displayed in the post depending on the segment chosen.

    In the back-end everything seems to be connected correctly and the field is showing in the Taxonomy page to upload an image. The problem I’m having is that I can’t find the way to retrieve that image ID or URL in my template page.

    Here is my code:


    <?php
    $args = array(
    'post_type' => 'stories',
    'post_status' => 'publish',
    'posts_per_page' => -1
    );

    $loop = new WP_Query( $args );

    while ( $loop->have_posts() ) : $loop->the_post();

    $segment = get_field('segment_story');
    $segment_bg = get_field('segment_image', $segment);

    echo 'bg: ' . $segment_bg['url'];

    I’ve even created a Taxonomy field type in my custom post type “Stories” called “segment_story” to force getting the term array manually but still nothing.

    I would appreciate any help with this! I’ve checked several ACF documentation pages and also checked some threads here but nothing worked for me so far.

    Thanks in advance!
    I.

  • Solved

    Programmatically set the value of a select2 field.

    Working with a front-end form, I want to programmatically set the value of a select2 taxonomy field after another field is updated.

    I have tried all manner of updating the value but it either doesn’t change or gets set to null. Any ideas? I thought I had a very simple task at hand, but its eluding me.

    This is what I have tried:

    
    const selectedValue = 12; //the id of the term I want to select
    $('#acf-field_5dcc4aa906709').val(selectedValue).trigger("change"); 
    
    var countyfield = acf.get_field('field_5dcc4aa906709');
    countyfield.val(selectedValue); 
    

    The first one should work according to the select2 documentation. This actually sets the value of the field to null.

    The second one I got from the ACF documentation. This updates the field object but does not update the field in the UI.

  • Solved

    Importing ACF

    Hi,

    I am performing an import of more than 500 items with the wp-ultimate-csv-importer free version.

    I managed to import all the ACF fields except for the relationship and taxonomy fields.

    As I read in this post: https://support.advancedcustomfields.com/forums/topic/importing-data-2/, serialized arrays of post IDs are used for relationships, serialized arrays of term IDs are used for taxonomies.

    I am trying to upload a CSV formatted like this:

    Title;Relationships;Taxonomies
    Test;”a:2:{i:0;i:651;i:1;i:649;}”;”a:2:{i:0;i:18;i:1;i:19;}”

    It doesn’t work.

    Is there a way to import these fields? How should the CSV be formatted?

  • Solving

    No Meta Box for Taxonomy Doesn’t Function as Intended

    Expected Behavior:
    I would expect the No Meta Box selection in the Meta Box field on the settings for my taxonomy: [My Taxonomy] > Advanced Settings > Visibility would hide the Taxonomy Options from my post editor.

    Actual Behavior:
    The Taxonomy Meta Box still appears in the post editor. The only way to hide it is to hide it completely by toggling the Show in UI to off, but I still want to be able to see my Taxonomy and terms in the dashboard.

  • Unread

    One field inside of while loop show the same content for every entry

    Hello, I am writing a cpt with acf, and one of the fields, show the exact same text for every post in the CPT (the first one). If I set it as draft it moved to the second.
    The strange part is that every other field in the loop works perfectly, only this one is problematic. The field is ‘testimonial_text’;

    Here is my code:

    // Testimonial Slider Shortcode
    function testimonial_slider_shortcode($atts) {
    $atts = shortcode_atts( array(
    'category' => '',
    ), $atts, 'testimonial-slider' );
    $args = array(
    'post_type' => 'testimonials',
    'posts_per_page' => -1,
    'tax_query' => array(

    array(
    'taxonomy' => 'testimonial_category',
    'field' => 'slug',
    'terms' => $atts['category'],
    'operator' => 'AND'
    )

    )
    );

    $testimonials = new WP_Query($args);
    $output = '<div id="testimonial-slider" class="carousel slide full-width" data-ride="carousel">';
    $output .= '

      ';

      $i = 0;
      while($testimonials->have_posts()) {

      $testimonials->the_post();
      $output .= '<li data-target="#testimonial-slider" data-slide-to="'.$i.'" class="'.($i == 0 ? 'active' : '').'">';
      $i++;
      }

      wp_reset_postdata();

      $output .= '

    <div class="carousel-inner">';

    $i = 0;
    while($testimonials->have_posts()) {
    $testimonials->the_post();
    $post = get_post();
    $person_name = get_field('person_name');
    $testimonial_text = get_field('testimonial_text');
    $company_text = get_field('person_company');
    $person_photo = get_field('person_photo');
    $person_photo_url = $person_photo['sizes']['large'];

    $output .= '<div class="item '.($i == 0 ? 'active' : '').'">';
    $output .= '<div class="inner-testimonial">';

    $output .= '<div class="carousel-caption">';
    $output .= '<div class="block-quote-img">';
    $output .= '';
    $output .= 'test';
    $output .= '<span class="author-text" maxlength="2">' .$testimonial_text. '</span>';

    $output .= '</div>';
    $output .= '<p class="author">' .' - ' .$person_name.' , '.$company_text.'</p>';
    $output .= '</div>';
    $output .= '<div class="img-div">';
    $output .= ''.$person_name.'';
    $output .= '</div></div></div>';
    $i++;
    }

    wp_reset_postdata();

    $output .= '</div><span class="glyphicon glyphicon-chevron-left"></span><span class="glyphicon glyphicon-chevron-right"></span></div>';

    return $output;
    }
    add_shortcode('testimonial-slider', 'testimonial_slider_shortcode');

    // Enqueue styles and scripts
    // Global plugin styles should be added to testimonails slider.css
    // Per project styles should be added to testimonial-project.css
    function testimonial_slider_scripts() {
    wp_enqueue_style( 'testimonial-slider-style', plugins_url( '/testimonial-slider.css', __FILE__ ) );
    wp_enqueue_style( 'testimonial-project-style', plugins_url( '/testimonial-project.css', __FILE__ ) );
    // wp_enqueue_style('bootstrap', 'https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css');
    // wp_enqueue_script(
    // 'testimonial-block-script',
    // plugins_url( 'blocks/testimonial-block.js', __FILE__ ),
    // array( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-components' )
    // );

    }

    add_action( 'wp_enqueue_scripts', 'testimonial_slider_scripts' );

    // Register Gutenberg Block

    add_action('init', 'wp_testimonial_block_init');

    function wp_testimonial_block_init() {

    register_block_type(__DIR__ . '/build', array(
    'render_callback' => 'theHTML'
    ));

    }

    function theHTML($atts) {
    $args = array(
    'post_type' => 'testimonials',
    'posts_per_page' => -1,
    'tax_query' => array(

    array(
    'taxonomy' => 'testimonial_category',
    'field' => 'slug',
    'terms' => $atts,
    'operator' => 'IN'
    )

    )
    );

    $testimonials = new WP_Query($args);
    $output = '<div id="testimonial-slider" class="carousel slide full-width" data-ride="carousel">';
    $output .= '

      ';

      $i = 0;
      while($testimonials->have_posts()) {

      $testimonials->the_post();
      $output .= '<li data-target="#testimonial-slider" data-slide-to="'.$i.'" class="'.($i == 0 ? 'active' : '').'">';
      $i++;
      }

      wp_reset_postdata();

      $output .= '

    <div class="carousel-inner">';

    $i = 0;
    while($testimonials->have_posts()) {
    $testimonials->the_post();
    $post = get_post();
    $person_name = get_field('person_name');
    $testimonial_text = get_field('testimonial_text');
    $company_text = get_field('person_company');
    $person_photo = get_field('person_photo');
    $person_photo_url = $person_photo['sizes']['large'];
    $output .= '<div class="item '.($i == 0 ? 'active' : '').'">';
    $output .= '<div class="inner-testimonial">';

    $output .= '<div class="carousel-caption">';
    $output .= '<div class="block-quote-img">';
    $output .= '';
    $output .= '<span class="author-text" maxlength="20">' .$testimonial_text. '</span>';

    $output .= '</div>';
    $output .= '<p class="author">' .' - ' .$person_name.' , '.$company_text.'</p>';
    $output .= '</div>';
    $output .= '<div class="img-div">';
    $output .= ''.$person_name.'';
    $output .= '</div></div></div>';

    $i++;
    }

    wp_reset_postdata();

    $output .= '</div><span class="glyphicon glyphicon-chevron-left"></span><span class="glyphicon glyphicon-chevron-right"></span></div>';

    return $output;
    }

    This is the code for the acf register

    // Add Custom Fields
    function add_testimonial_custom_fields() {
    if(function_exists('acf_add_local_field_group')):

    acf_add_local_field_group(array(
    'key' => 'group_testimonial',
    'title' => 'Testimonial Fields',
    'fields' => array(
    array(
    'key' => 'field_person_name',
    'label' => 'Person Name',
    'name' => 'person_name',
    'type' => 'text',
    'required' => true,
    'show_in_rest' => true,
    'wrapper' => array(
    'width' => '50',
    ),
    ),
    array(
    'key' => 'field_testimonial_text',
    'label' => 'Testimonial Text',
    'name' => 'testimonial_text',
    'type' => 'wysiwyg',
    'required' => true,
    'show_in_rest' => true,
    'wrapper' => array(
    'width' => '50',
    ),
    ),
    array(
    'key' => 'field_person_photo',
    'label' => 'Person Photo',
    'name' => 'person_photo',
    'type' => 'image',
    'preview_size' => 'full',
    'required' => false,
    'show_in_rest' => true,
    ),
    array(
    'key' => 'field_person_company',
    'label' => 'Company',
    'name' => 'person_company',
    'type' => 'text',
    'required' => false,
    'show_in_rest' => true,
    ),
    ),
    'location' => array(
    array(
    array(
    'param' => 'post_type',
    'operator' => '==',
    'value' => 'testimonials',
    ),
    ),
    ),
    ));

    endif;
    }
    add_action('acf/init', 'add_testimonial_custom_fields');

  • Unread

    Showing certain post categories on custom post type

    Dear ACF Community.

    I’m struggeling with something that is in fact very simple, and i suppose it’s an easy thing for some of you to solve.

    I have several blog posts for bicycle tours attached to a custom taxonomy for countries.

    I also have set up a custom post type for countries, to write a bit about the country and show only blog posts for this country, according to the category.

    But i don’t get it run, that only blog posts for this country are shown on the country page.

    The URL for the country page would be e.g. https://www.rogonneur.com/country/germany/
    And the Post to appear in the blog teaser section there would be e.g. https://www.rogonneur.com/cycling-to-watch-the-first-freiburg-international-match-in-years/ as it’s only connected to the category “germany”.

    Is this somehow too advanced? I’d appreciate any help!
    Kind regards,
    Dominic

  • Unread

    Display field on single product page

    Hello, I have made a field to add to the Woocommerce attributes. I have added a picture below for more clearancy.

    explaination

    I am trying to display the field on the single product page. I have added the following code to the content-single-product.php template file.

    
    $terms = get_the_terms( $product->id, 'pa_merk');
    		var_dump($terms);
    		
    		$image = get_field('afbeelding_merk', $terms->taxonomy . '_' . $terms->slug);
    		
    		// Display the image if it exists
    		if ($image) {
    			echo '<img src="' . $image . '" />';
    		} else {
    			echo "<p>Foto niet gevonden.</p>";
    		}
    

    What am I doing wrong?

  • Helping

    Bug relationship between taxonomy and users

    Hi,

    I found a bug in the relationship between a custom taxonomy and the users.
    I have a custom taxonomy ‘genres’ with an assigned field group with a field for assigned users.

    Name: ‘rel_users’
    Field Type: User
    Select Multiple: True
    Bidirectional Target Field: rel_genres

    A second field group is assigned to ‘users’ and has a field for assigned taxonomy.

    Name: ‘rel_genres’
    Field Type: Taxonomy
    Appearance: Multi Select
    Bidirectional Target Field: rel_users

    If I assign a user to a genre term, everything is ok.
    term_id: 15
    user_id: 5

    wp_usermeta
    meta_key: rel_genres
    meta_value: a:1:{i:0;s:2:”15″;}

    wp_termmeta
    meta_key: rel_users
    meta_value: a:1:{i:0;s:1: “5”;}

    In the backend the relations are displayed correctly in the user profile and on the taxonomy edit page.

    However, when I make changes on the taxonomy edit page, the target value is changed incorrectly (when I delete, save and reassign the user) so that the assignment in the user profile disappears. When saving the taxonomy term, the bidirectional target field is now saved as an interger array instead of string array.

    wp_usermeta
    meta_key: rel_genres
    meta_value: a:1:{i:0;i:15;} <- integer array!

    wp_termmeta (unchanged)
    meta_key: rel_users
    meta_value: a:1:{i:0;s:1: “5”;}

    It seems that the array with integer values destroys the relationship on the side of the user.

    best regards
    steffen

  • Solving

    Showing all products with a specific taxonomy

    I have created a custom taxonomy (book authors). Now I want to show all book authors and their respective custom fields on a page, how do I do that?

  • Solved

    ACF Taxonomy Fields: Tailored Access Permissions for Different Roles

    Hello, everyone,

    I need help in realizing client requirements.

    Within the ACF group, I’ve created three fields (primary_tags, secondary_tags, and other_tags), all of which are of type taxonomy (tag). “Create terms” is set to “switch on,” return value is “term object,” and appearance is set to “multi-select.” These fields are displayed on the posts.

    My client requests that only administrators can add new primary and secondary tags to the list, while other users can only add tags that already exist in the list. As for the “other_tags” field, it is open to all users.

    If you have any ideas on how this could be achieved, please send me your suggestions. Thank you in advance!

  • Unread

    Website crashes when taxonomy i set to “Term object”

    I’m using ACF to make taxonomies in a field group together with Woo, adding the fields to my products.

    However, I want the object of the taxonomy and not the ID but when I set it to “Term object” the entire page where this is referenced crashes, no matter if I’m doing it through WP Bakery or shortcodes.

    Is there a clash somewhere? I’ve tried to use really unique names. It only crashes the site if it’s on “Term object”, not “Term ID” and it only crashes if the field has a value associated with it.

    Field in fieldgroup
    Field in fieldgroup cont
    Taxonomy

  • Helping

    Show A Default Field Group on New Post Page

    Hello,

    I was able to set a default post taxonomy but it does not show the ACF Field group until I manually click on it to change it. Can you provide any insight? I think I would need to trigger an event by javascript to show but I am not sure how to do that.

    To clarify, I have three post taxonomies: TBL, FBL and College. The location rules in ACF are to show depending on which taxonomy is selected. I have set a default to TBL but even though it is selected as default and checked the ACF Field Group Box for TBL does not show until I click on another option and back on TBL. I would like the TBL field box to show on page load.

    Eventually, I would like it to show the ACF field box for the last selected option be it TBL, FBL or College on page load.

    Thank you for your help in advance and great plugin by the way!

    David

  • Solved

    Need a solution for a single True/False Field to set a stored taxonomy term

    I need a solution to provide a single True/False field with the ability to activate a special taxomy term in the backend of a custom post type entry.
    Thanks in advance for any help!

  • Unread

    Can’t filter by custom media taxonomy in editor

    I successfully used ACF custom taxonomies to add Media categories. I added the dropdown filter via functions.php to the Media Library and can sort items while I’m in the Media Library. But I don’t know how to add this dropdown to the Select or Upload Media modal so I can filter images by category when adding images in a post or page. Is this even possible to do? If it is, can someone point me in the right direction or documentation for this?

  • Unread

    ACF Post Field and Taxonomy Issue

    Hello, I’ve got a teaser snippet that pulls the taxonomy info for a custom post type and works fine when using a wpquery:

    setup_postdata($post);
    $postid = $post->ID;
    $item_image = get_field("listing_image", $post->ID);
    
        // TAXONOMY //
        $taxonomy = 'types';
        $terms = get_object_term_cache( $postid, $taxonomy );
        $outputpill = '';
        $i = 1;
    
        $teasertype = '';
        foreach($terms as $term) {
            if ($i == 2) { break; }
        if(!empty($outputpill))
            $outputpill .= '';
            $outputpill .= '<div class="cat cat-pill pill-'. $term->slug . '">'.$term->name.'</div>';
            $teasertype = $term->slug;{}
            $i++;
       
        }
    
        // BUTTON SWITCH //
        if($teasertype){
        switch($teasertype){  
            case 'article':
                $ctaclass= "article";
                $ctatext= "Read Now";
    
    etc etc etc 

    When I use this snippet on another page that references these custom post types using a Post Object field, it throws an error when looking up the taxonomy:

    Warning
    : foreach() argument must be of type array|object, bool given in
    /Users/louis.plante/Local Sites/smartvaultcom/app/public/wp-content/themes/smartvault-wordpress-website/inc/snippets/_incl_resources–teaser.php
    on line
    17

    Code used:

    									<?php $post_objects = get_field('campaign_group1_item_resource'); ?>
    									<?php
    									if( $post_objects ):
    									foreach( $post_objects as $post): 
    										setup_postdata($post); //set new $post_object
    										get_template_part( 'inc/snippets/_incl_resources--teaser' );
    									endforeach;
    									wp_reset_postdata(); //reset global $post
    									endif;
    									?>
  • Unread

    Google Maps Displaying in Elementor

    Hi there! I’m not a developer, just a Dad that is trying to create a cool website for his Jazz Musician son. While I’m using Elementor, I’m also trying to minimize plugins. That said, I’ve created a Custom Post Type called “Gigs” to dynamically highlight upcoming shows that my son will be playing. I’ve also created a Custom Taxonomy called “Locations” to dynamically bring in Map, Location URL, and Image for instance. I cannot get any of these custom fields associated with the Locations Taxonomy to display. I’ve also created a second CPT called “Gig Locations” and tried to relate them to the Gigs CPT so that I could display its respective custom fields.

    I can place an ACF Google Maps field directly in the Gigs CPT and it will display through the Elementor Google Maps widget. But the ACF Google Maps fields in either the Taxonomy or 2nd CPT will not display. When attempting to put custom PHP code snippets to “get_meta_terms” etc., nothing happens or the site crashes entirely.

    Thanks in advance for your help!

    qthornton.com

  • Unread

    New Taxonomy Data Not Saved

    Just migrated from CPTUI. Tried to create a new taxonomy for a CPT. The response said it was created, but the only data that gets saved is the name of the taxonomy. Nothing else. Has anybody experienced this and found a solution? Thanks.

  • Unread

    acf taxonomy from gravity forms

    Hi,
    I created a portfolio taxonomy with ACF and I’m trying to pass trough a tag field from Gravity Forms to this taxonomy. But isn’t works.

    This is the code:

    add_filter(“gform_post_data”, “custom_taxonomy”, 10, 2);
    function custom_taxonomy($post_data, $form){
    //—————————————–
    //Replace “post_tag” with your taxonomy name
    $custom_taxonomy = “obituarios_localidades”;
    //—————————————-

    $tags = implode(“,”, $post_data[“tags_input”]);
    $post_data[“tax_input”] = array($custom_taxonomy => $tags);
    $post_data[“tags_input”] = null;
    return $post_data;

    And the portfolio categories are: Obituarios
    Localidades

    Can anyone help me please?

    Thanks.

  • Helping

    how to connect category and tag to the articles made under ACF new post type?

    1- My issues is: the new articles, moved from “wordpress > articles” to a new post type made by ACF, cannot read the new category (taxonomy with hierarchy) and tag (taxonomy without hierarchy) that I created on ACF.

    For example, based on my theme, the category of an article shows above the article’s title. Now, the articles under a new post type shows the old category, but not the the new category (taxonomy with hierarchy).

    based on my theme, the tag of an article shows at the end of the article. Now, the articles under a new post type shows the old tags, but no the new tag (taxonomy without hierarchy).

    A friend of mine recommended me to build a new template for single post for the new post type, but I’m wondering if there is any other ways to do it. Thank you.

    And my next question would be…if this works, how I can make the “apprearance > widgets > mian sidebar” to read all category or tag from different post types…

    Thanks for your answers.

  • Helping

    Searchable Filter for WooCommerce Products Based on Model and Model Year

    Dear people,

    I’ve quietly been struggling with the issue below for quite some time and have now decided to seek help through this forum.

    I have created two taxonomies named “Model” and “Modeljaar” (Model Year). Additionally, I’ve set up an ACF field group linked to WooCommerce products.

    Now, when specifying the compatibility of a WooCommerce product, I can choose both the “Model” and the “Model Year.”

    However, if, for instance, I have 3 models – Volvo, Volkswagen, Audi – and model years such as “2015, 2016, 2017, 2018,” I encounter a problem.

    For example, when I select Volvo and check model years 2015 and 2016, and also select Volkswagen and check model years 2017 and 2018, an issue arises.

    The system fails to distinguish, assuming that Volkswagen is also linked to model years 2015 and 2016, as these model years are not linked to the “Model” taxonomy.

    Ultimately, I need to create a search filter, such as with Search & Filter, and want to be able to search by model and model year. So, if you choose a Volkswagen now, you should also be able to find it when filling in the filter for model year 2015 or 2016.

    I hope I’ve explained my problem clearly.

    Do you have any ideas on how I can solve this?

    Kind regards,

    Miguel

  • Unread

    ACF + Woocommerce Categories Backend

    Hi,
    in recent days I had opened a request on the general forum of the repository regarding this question of mine.

    I created some groups of fields in ACF that are shown in the sidebar, when inserting a product on woocommerce.

    What I can’t do is show the fields in relation to the woocommerce categories.

    Ex.
    – woocat 1 -> group_1
    – woocat 2 -> group_2

    In Position Rules I set the following rules:
    1. Content Type = Product
    2. User Role = Administrator
    3. Item Taxonomy = woocat 1

    But despite this, the group of fields appears in every product page.

    But having read the documentation for developers I created this function which should solve it and could possibly help other users too:

    // Verifica se ACF è installato prima di utilizzare i filtri ACF
    if (function_exists('acf')) {
        add_filter('acf/load_field/name=attributo_montaggio', 'campoextra_acf_montaggio');
        function campoextra_acf_montaggio( $field ) {
            global $current_screen, $post;
            // Verifica se l'utente corrente ha le autorizzazioni necessarie
            if (!current_user_can('edit_posts')) {
                // L'utente corrente non ha le autorizzazioni necessarie, esci
                return $field;
            }
             // Ottieni i termini della categoria corrente
             $terms = get_the_terms($post->ID, 'product_cat');
             
            // Verifica se $terms è un array non vuoto
            if (is_array($terms) && !empty($terms)) {
                //$category_id = $terms[0]->term_id;
                $category_name = $terms[0]->name;
    
                // Array di nomi di categorie da confrontare
                $allowed_categories = array(
                    "Cat Name 1",
                    "Cat Name 2",
                    // Aggiungi altri nomi di categorie secondo necessità
                );
    
                // Verifica se non siamo in modalità amministratore o se il tipo di post non è 'product' o se l'ID della categoria non è nell' array
                if ((!is_admin() && $current_screen->post_type != 'product') || !in_array(strtolower($category_name), array_map('strtolower', $allowed_categories))) {
                    return false;
                }
            }
    
            return $field;
    
        }
    
    }

    I used the load filter and not the prepend.
    Do you think it can be improved?

    Thanks

  • Solving

    ACF Taxonomy

    Hey.

    Im trying to create a loop-item for my custom Taxonomy “product_categories” i’ve assigned 2 fields to it, name => “c_name”, image => “c_image”.

    Now when I im in my loop template, i’ve assigned those fields to the text and image but its not showing me anything. I’ve tried searching internet but haven’t got lucky. so posting here in the end.. im using ACF PRO.

    Do reply to my thread.

    Thank You.

Viewing 25 results - 26 through 50 (of 4,561 total)