ACF Taxonomy in Loop
Can you not do something like this? $initDate = get_field(‘initial_date’,$term); echo $initDate;
Can you not do something like this? $initDate = get_field(‘initial_date’,$term); echo $initDate;
$_POST sometimes empty even though isn’t when using edited_[taxonomy] hook
How can I order a post query’s results based on the number of matching taxonomy terms?
To sort hierarchically, try adding a sorting function to your functions.php (or plugin). // This will sort and place everything in the $into array function sort_terms_hierarchically(Array &$cats, Array &$into, $parentId = 0) { foreach ($cats as $i => $cat) { if ($cat->parent == $parentId) { $cat->posts = array(); $into[$cat->term_id] = $cat; unset($cats[$i]); } } foreach … Read more
wp_insert_term doesn’t want to enter its data into custom taxonomy
@ricardio-de-penning I think you are going on wrong direction. You just want to get only those posts which is related to current category right? If yes then you need to filter post using tax_query like below. $args = array( ‘post_type’ => ‘post’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘category’, ‘field’ => ‘term_id’, ‘terms’ => array($cat_ids), … Read more
I figured it out: update_term_meta( $term_id, ‘organization’, $_POST[‘organization’], true ); should have been update_term_meta( $term_id, ‘organization’, $_POST[‘organization’] ); Where the fourth parameter makes it unique.
automatically select taxonomy based on post meta
After messing with some code I found a solution: just use this code and a lot if information will be showed. Within all this data you search for the categorie that is inside your taxonomy and you’ll see the taxonomy-> name. // Show all data of all taxonomies function print_tax_data(){ $data = get_terms(); print_r($data); } … Read more
I had to add the element by extending WPBakeryShortCode class.