Plugin Author
ulfben
(@ulfben)
Are you saying that POST belongs to both K and E, but WP-dTree displays it as a child of (only) the first category?
Yes. When I look at the post in admin panel there are both of categories(K, E) but sort by name, so the first category is E.
I’ve written my own code without ajax and it works :]
Plugin Author
ulfben
(@ulfben)
You say your POST is in categories Offer, E and K. These are nested like
Offer
Offer->E
Offer->E->K
Why is the POST in all of them, and not *only* in K?
The POST is one of products from offer. My client want, that in sidebar is list of all categories:
-you click on E category and the script shows all subcategories or, if doesn’t exist all post from this categegory,
-next, you click on K category and you see all posts from this category.
This should look like this:
click
‘Elewacja’ is the E category
‘Kamień regularny’, ‘Kamień nieregularny’ are K category
‘Słońce Bałkanów’, ‘Słońce Adriatyku’ etc. are POSTS category
Plugin Author
ulfben
(@ulfben)
I don’t think you answered my question. Is there a reason to keep POST in both E and K?
Yes, if you are in Offer in content you see all of products – with pagination. When you select E from the submenu, in the content you see products only from E category etc.
When i put POST into K, you go to offer and don’t see it.
Plugin Author
ulfben
(@ulfben)
I’m not trying to be obtuse or anything, but I’m pretty sure something like
$query = new WP_Query( 'category_name=Offer' );
Would yield all posts in Offer or subcategories.
So (unless I’m mistaken) this should be a fairly simple update to your theme, rather than a new feature of WP-dTree.
<?php if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post(); ?>
… and you know the rest. 🙂
LOL. I’ve thought that this:
$query = new WP_Query( 'category_name=Offer' );
shows posts only from Offer but not from subcategoies.
My mistake. Thanks a lot! :]
If you’re intrested, you can check how my code works here(only category ‘ELEWACJE’ have posts) :]