WordPress Taxonomy Hierarchy - Hiding Children - wordpress

I have a hierarchical taxonomy like this:
CATEGORY 1
SUB CAT 1
Product A is in Sub Cat 1
Product B is in Category 1 and Sub Cat 1
By default, WordPress is going to show me both products when I'm browsing Category 1. I've written a function that will hide the products that are in sub-cats, but what I really want to do is to get a list of all the products that are in Category 1. If I use get_objects_in_term() it pulls everything in the parent and children.
Any ideas to get only the products that are actually a part of Category 1?

Related

How make subcategories like divide between products in woocomerce

How make subcategories like divide between products in woocommerce. It's must be looks like this:
Category 1
- Subcategory 1
-- Product
-- Product
-- Product
- Subcategory 2
-- Product
-- Product
-- Product

WooCommerce duplicate slugs for categories

I am trying to setup a mobile store with woocommerce and I have some problems when I am creating categories.
For an example;
Category 1 :
Product Apple
Category 2 :
Product apple
and I want to display the URL like below
www.site.com/category-1/product-apple
www.site.com/category-2/product-apple
www.site.com/category-3/product-apple
But now when I am creating the second category called "product-apple" it says slug already exist.
How can I solve this problem ?
wordpress.org/plugins/woocommerce/

Creare a Link with tag and category

I have a list of product that have the same tags, but different categories.
For example: the tag "Spain" has two categories. So my list is:
Category 1 --- 3 products
Category 2 --- 1 product
When I click in Category 1 I want to display it to an other page showing something like this:
Category 1
Product 1
Product 2
Product 3
How I create this link to pass the category and the current tag?
Any idea?

How to display parent category with first level childs (Drupal)?

How to display categories with views like this?
Category1
Subcategory1, Subcategory2, Subcategory3...
Category2
Subcategory1, Subcategory2, Subcategory3...
You can do this with help of views too, I have implemented this at my workplace if you need I will provide you the export of my view.
I am showing here, the complete scenario what I understood, with the main points what you required, to achieve the exact view:
- I have one Vocabulary named "Test"
- Test has two Parent categories, category 1 and category 2.
- Each category has subcategories: For example
Category 1
sub category 1
sub category 2
Category 2
sub category 3
sub category 4
Output you want to Display:
Category1
Subcategory1, Subcategory2, Subcategory3...
Category2
Subcategory1, Subcategory2, Subcategory3...
Steps to achieve desired view:
Create a view of Taxonomy Terms for vocabulary "Test"
Add Field "Term Name"
Create Relationship for Taxonomy Parent Term
Add Relation in added field "Term Name".
Add a global PHP field, where you will get parent term tid in $data variable.
Use a simple SELECT query to fetch subcategories using JOIN, tables you need are taxonomy_term_data and taxonomy_term_hierarchy.
show all the subcategories separated by ',' or any other desired separator.
Lastly you need to group by with added field name "Term Name".
After doing all these steps, you will definitely get the desired view result.
Hope this will help you, if you found any issue, free feel to reply.
I can also provide you the export of my view, if you required.

Create chainned menu in Wordpress

I'm using WordPress 3.5 as CMS to develop my personal website.
The reason I'm writting, is that I need a way to implement a code or plugin to allow users to navigate through posts using dependent(chained) dropdown lists.
In other words I would like 3 dropdown menus to be dynamically populated based on the selection chosen in the previous dropdown lists.
This would consist of:
Dropdown 1: Category *
Dropdown 2: Sub- Category *
Dropdown 3: List of posts in Sub-Category *
*Dropdown 1 would be pre populated with categories.
*Dropdown 2 would list the sub categories of menu 1 based on the user selection.
*Dropdown 3 would list the posts in the sub category chosen in menu 2.
To help you understand further, in my website I have the Category "TV Series" which has as sub-categories(child) other series, like "Dexter", "CSI:Miami" etc. Series also have other sub-categories(child) the number of seasons, like "Season 1" "Season 2" "Season N". Each season contains the appropriate posts.
The Hierarchy is like this:
Tv Series (main category)
-Dexter
--Season 1
--Season 2
--Season n
-CSI:Miami
--Season 1
--Season 2
--Season n
So for example the dynamic dropdowns I would like to use are the following:
Dropdown 1: Select TV Show (Category)
Dropdown 2: Select Season (sub-category)
Dropdown 3: Select Episode (posts)
I would really appreciate if you could help me with the matter as I was searching the web for the past few days without any results.
Thanks in advance.
I will suggest you to use Multi-Level-Navigation Plugin http://wordpress.org/extend/plugins/multi-level-navigation-plugin/

Resources