get_category_children/ the new get_term_children not work

I have a custom Walker for a Advanced Search, that outputs the categories for multiple search by categories in checkbox. The Problem here is, that i use the get_category_children for the children Categories, but its old, and the new code is get_term_children, but when i replace it with it, then comes a error message, like … Read more

query only direct child and sub-terms of a current term archive

i’m using woocommerce on my theme, and it comes with a proudct_cat term as a defualt catagory on the shop proudct. I need to show on every proudct_cat archive its direct child and the sub-tems, but not the sub terms child. I tried: <?php $thispage = $wp_query->post; wp_list_categories(“taxonomy=product_cat&term=”. $term->slug.”&title_li=&child_of=”.$thispage->slug);?> and it returned all proudct_cat as … Read more

How can I get the term_id from the action hook ‘set_object_terms’?

I have the following code and I want to use the term_id inside that function. I aware that the variable $terms contains the term; however, I do not know how to get the term id from it. add_action(‘set_object_terms’,’wpse5123_set_object_terms’,10,4); function wpse5123_set_object_terms($object_id, $terms, $tt_ids, $taxonomy){ if($taxonomy == ‘category’){ echo ‘<pre>’; print_r($terms); exit; } } I tried the … Read more

Display Categories Assigned to a WooCommerce Product

I am using WooCommerce with SuperStore theme. In meta.php file is this line, echo $product->get_categories( ‘, ‘, ‘<span class=”posted_in”>’ . _n( ‘Category:’, ‘Categories:’, $cat_count, ‘woocommerce’ ) . ‘ ‘, ‘.</span>’ ); which displays the assigned categories to the post, but not in hierarchical order. I want to display these in hierarchical order. I also found … Read more

is action hook not working on quick edit?

This code is not working on quick edit? function cpt ($term_id) { print_r($_POST); } add_action(‘create_post_tag’, ‘cpt’); Answer According to WPSeek’s page on the create_{$taxonomy} action hook, and also the new-to-me WordPress Developers’ docs on the same hook, there are two required parameters: Parameters $term_id (int) (Required) Term ID. $tt_id (int) (Required) Term taxonomy ID. So … Read more

Issue On Listing Woocommerce Parent Tag List

I am having some issue on getting top level terms of product_cat Taxonomy of WooCommerce First of all I have a code which list all Terms in product_cat as: $terms = get_terms(“product_cat”); if ( !empty( $terms ) && !is_wp_error( $terms ) ){ echo “<ul>”; foreach ( $terms as $term ) { echo “<li>” . $term->name … Read more

Issue on Listing Sub Product Categories In Woocommerce

Using Following code I am able to list all top level Categories on Woocommerce Product Categories $args = array( ‘number’ => $number, ‘orderby’ => ‘title’, ‘order’ => ‘ASC’, ‘hide_empty’ => $hide_empty, ‘parent’ => 0, ‘include’ => $ids ); $product_categories = get_terms( ‘product_cat’, $args ); $count = count($product_categories); if ( $count > 0 ){ foreach ( … Read more

Get all terms assigned to a post from different taxonomies

There are different taxonomies. I have assigned different tags from these taxonomies to different posts. Can anyone help me to get all the terms which are assigned to a post. (Different terms from different taxonomies are assigned to a post) Answer WordPress tracks which object types taxonomy applies to. This can be established on taxonomy … Read more

How to manage a bookstore

I am planning to make a bookstore website with WordPress. Can you give me some advice to manage my store? I’m not sure whether to choose Custom Post Type or Custom Taxonomy to manage the authors of the book. Because a book can be written by many authors and an author will write many different … Read more