Show related posts on single.php, grouped by taxonomy terms, with Advanced Custom Field post object selected

I’d recommend creating 3 separate [‘associated_items’] fields instead of 1. For Example: [‘associated_articles’] & “Filter for taxonomy term: Articles” [‘associated_presentations’] & “Filter for taxonomy term: Presentations” [‘associated_news’] & “Filter for taxonomy term: News” Note: Filtering for the taxonomy term, limits the related posts available to choose from as well, which results in a better user … Read more

Add filter to Admin list for all custom post types by their custom taxonomies

I found a code which work only with single taxonomy and modified it. add_action( ‘restrict_manage_posts’, ‘my_restrict_manage_posts’ ); function my_restrict_manage_posts() { global $typenow, $post, $post_id; if( $typenow != “page” && $typenow != “post” ){ //get post type $post_type=get_query_var(‘post_type’); //get taxonomy associated with current post type $taxonomies = get_object_taxonomies($post_type); //in next loop add filter for tax if … Read more

Get fuzzy matches from get_term_by

There’re several questions you should ask yourself: #1) Are the “language codes” actually ISO 639-2 compatible? Stephen Harris and me build a list of all available ISO 639-2 language codes – [available on GitHub on the WeCodeMore-Label account] – that should be used. This is the official list (build from the official ISO source). In … Read more

Custom Taxonomy dont save in a frontend form for post a custom post

I think you have used wrong tax_input parameter value for wp_insert_post() function it should be array like this array( ‘taxonomy_name’ => array( ‘term’, ‘term2’, ‘term3’ ) ) as shown in the following code $my_post = array( ‘post_title’ => $title, ‘post_content’ => $content, ‘post_status’ => ‘publish’, ‘post_type’ => ‘faenas’, ‘tax_input’ => array( ‘faenas_combenef_category’ => array( $location … Read more

WordPress custom taxonomy

get_terms(); accept include as an array, you are trying with a string term id instead of array, try this $parent_terms = get_terms($taxonomyName, array(‘include’ => array(’67’), ‘orderby’ => ‘slug’, ‘hide_empty’ => false));

Show terms in archive page

get_terms() retrieves terms in general, it makes no connection to a current post in loop. What you need is one of template tags, which retrieve terms for the post. For example the_terms(): while (have_posts()) : the_post(); the_terms( get_the_ID(), ‘event_cat’ ); endwhile; There are quite a few functions dealing with terms, depending on what you want … Read more