How to get category image custom post type taxonomy in wordpress?

From the details page of the WPCustom Category Image Plug-in : https://wordpress.org/support/plugin/wpcustom-category-image 1st – Go to Wp-Admin -> Posts(or post type) -> Categories (or taxonomy) to see Custom Category Image options. 2nd …depending on whether you want to show a single category image or display several in a loop – //SINGLE echo do_shortcode(‘[wp_custom_image_category onlysrc=”https://wordpress.org/plugins/wpcustom-category-image/false” size=”full” … Read more

How do I provide a “show all posts” link in a paginated term archive?

This method will set it up so that if you add /all to the end of your taxonomy archives, it will show all posts. First, when registering the taxonomy, make sure you set the ep_mask to EP_CATEGORIES. This means we can add a custom endpoint to it. function wpse_277843_register_taxonomy() { register_taxonomy( ‘game_go_series’, ‘game_go’, array( ‘rewrite’ … Read more

WPML Translating a term/taxonomy programmatically

Ok I found the solution. Actually taxonomy name on icl_translation table is stored with prefix called “tax_” which means taxonomy. The above code would work like this: $trid = $sitepress->get_element_trid($englist_term_id, “tax_taxonomy_name”); $sitepress->set_element_language_details($new_term_id, “tax_taxonomy_name”, $trid, $lang_code, $sitepress->get_default_language()); The difference is tax_ prefix. Cheers!

Problems with function on function.php

Did you try to use add_action without priority? On the last line, you specify the priority. Lower numbers correspond with earlier execution, and functions with the same priority are executed in the order in which they were added to the action. function test_1234567() { // Get term by name ”news” in Categories taxonomy. $category = … Read more

Append a term to WooCommerce product existing product category terms

You just need to add a missing boolean argument in wp_set_object_terms() function like: wp_set_object_terms($post->ID, $term->term_id, ‘product_cat’, true); This time the term will be appended and not replaced. You should check that the term doesn’t exist yet on the product, before appending it like: add_action( ‘transition_post_status’, ‘new_product_add’, 10, 3 ); function new_product_add( $new_status, $old_status, $post ) … Read more

How to dynamically add custom taxonomy terms as a sub-menu of an existing menu item, using custom walker class

Okay, I figured it out. It’s not very smooth, but at least it works as I want it to. Will have to do some refactoring. The issue was that wp_nav_menu() got called earlier than the taxonomy registration. I had accidentally placed it in my theme-functions.php and forgotten about it, then called it again in my … Read more

how to create a proper query for getting a list of users with taxonomy related meta key

Objective I want to list sp_provider (hospital,clinics,doctors) whose sub_category is suppose ‘neurology’ rephrasing the words: I want to list users with sp provider category(meta value) such as “hospital” and the user have a sub category(meta value) “neurology” sp_provider is a meta value in user profile (sp-provider maybe a post-type or something for user management screen … Read more