Support

Account

Home Forums General Issues How to add custom field to a category? Reply To: How to add custom field to a category?

  • $queried_object = get_queried_object();
    	        $taxonomy = $queried_object->taxonomy;
    			$term_id = $queried_object->term_id;  
    
    			$grade = get_field('grade', $queried_object);
    			$grade = get_field('grade', $taxonomy . '_' . $term_id);
    
    			var_dump($grade);

    The var_dump shows “NULL NULL NULL”