Catchable fatal error: Object of class WP_Error
Catchable fatal error: Object of class WP_Error
Catchable fatal error: Object of class WP_Error
You can use taxonomy term meta for that. Like you said you have “team” and “player” taxonomy. Now you can add a taxonomy term meta on “player” taxonomy’s terms and save the “team” terms(where the “player” belong) ID on that “player” taxonomy term meta. Then get the the player based on that “team” taxonomy term … Read more
More complicated than I realized. May not be pretty but it works. functions.php function get_btf_link( $taxonomy = ”, $post = false ){ if ( ! $post ) { global $post; } $url = get_post_type_archive_link( $post->post_type ); $terms = get_the_terms( $post, $taxonomy); if ( $terms ) { foreach ( $terms as $term ) { $url = … Read more
First Question’s Answer: For filtering based on your terms first letter you need to filter the query, which you can do with the terms_clauses hook. By putting the below code block in your theme’s functions.php you can do that- function the_dramatist_filter_term_clauses( $clauses ) { remove_filter(‘term_clauses’,’the_dramatist_filter_term_clauses’); $pattern = ‘|(name LIKE )\’%(.+%)\’|’; $clauses[‘where’] = preg_replace($pattern,’$1 \’$2\”,$clauses[‘where’]); return … Read more
Well I found the answer. The code is correct. Wordpress do in taxonomy.php Line 3392 $count += (int) $wpdb->get_var( $wpdb->prepare( “SELECT COUNT(*) FROM $wpdb->term_relationships, $wpdb->posts WHERE $wpdb->posts.ID = $wpdb->term_relationships.object_id AND post_status=”publish” AND post_type IN (‘” . implode(“‘, ‘”, $object_types ) . “‘) AND term_taxonomy_id = %d”, $term ) ); $count is empty because post_status=”publish” in … Read more
Your permalink structure prefix is controlled by the with_front argument: ‘rewrite’ => array( ‘slug’ => ‘my_taxonomy’, ‘with_front’ => true, // changed to include prefix ‘hierarchical’ => false, ‘ep_mask’ => EP_NONE ),
As Milo mentioned, this is an Advanced Custom Fields plugin (ACF) question. As such I have raised this ticket with the ACF support team here https://support.advancedcustomfields.com/forums/topic/how-to-replace-hard-coded-list-of-custom-taxonomy-terms-based-on-custom-field-qu/
Thanks Milo, it was “has_term” that I needed. I found some VERY complex “answers” elsewhere that seemed to be addressing my situation, but am glad it was just a matter of using the right function. One thing that tripped me up for a while: has_term takes the specific term, THEN the taxonomy as arguments – … Read more
You can filter menu items with the wp_nav_menu hook
After looking at get_the_terms() again I think I found a better solution: functions.php global $reviews_cat_id_brand; $reviews_cat_id_brand = 158; // using # in case string changes if( !function_exists(‘reviews_print_subcat_link’) ){ function reviews_print_subcat_link($cat_id){ $items = get_the_terms(get_the_ID(), ‘review-category’); $subcat_array = []; foreach ($items as $item) { if($item->parent === $cat_id) { $subcat_array[] = ‘<a href=”‘.get_term_link($item).'”>’.$item->name.'</a>’; } } return $subcat_array; } … Read more