hungzai
Forum Replies Created
-
I succeeded. Thanks guys once again!
Thanks man! You guys gave me some ideas to work on. Cheers!
I am not asking for advice for commercial products. I am asking php related help. Thanks for your reply anyway.
Apologies. I am not using any known theme. I am developing my own theme and creating my own design and style. Pardon me, did I post in the wrong forum? Thanks.
Forum: Fixing WordPress
In reply to: Checking for subsub category and echo it.For those who are keen, the solution is here
if (post_is_in_descendant_category($cat_ID)) foreach((get_the_category()) as $childcat)if (cat_is_ancestor_of($cat_ID, $childcat)) echo $childcat->cat_name . ' ';
Just add this to after the line “setup_postdata( $post );”
Thank you so much John. Cheers!
Sorry for the late reply. Yes. Do you have an email which I can email you the picture? Thanks.
Forum: Fixing WordPress
In reply to: Checking for subsub category and echo it.Still struggling. Basically my structure is like this.
A
-B1
–C1
-B2
–C2
-B3
–C3The posts are listed in Cs. So the above code checks for posts in C and will echo respective B with the titles of the posts. Now I would like to echo B and followed by C in front of the titles. Eg (C)titles.
Struggling for 2 days. Would be grateful for any help. Thanks.
Forum: Fixing WordPress
In reply to: Checking for subsub category and echo it.Anyone have any idea? Basically just need to check the sub category under “$inrCategory” and echo it in front of
<a href="'.get_permalink($post->ID).'">'.get_the_title().'</a>
Thanks in advance.
Forum: Fixing WordPress
In reply to: List posts in sub-sub categories of a category.Hi, this code works perfectly. Now I would like to add the individual C level category of a particular post to the output. Echoing it just before the titles. Am struggling to do so. Could anyone help please?
[ No bumping please. ]
Forum: Fixing WordPress
In reply to: List posts in sub-sub categories of a category.Perfect! You are genius! THANK YOU SO MUCH!
Forum: Fixing WordPress
In reply to: List posts in sub-sub categories of a category.Basiscally I want the code to do this
Under Category A, check every B’s child for postings.
If there are postings, echo title of B followed by title all the postings. Omit those Bs without any postings in their child categories.
Forum: Fixing WordPress
In reply to: List posts in sub-sub categories of a category.My categories are structured in this manner.
A > B1/B2/B3/B4 > C1/C2/C3/C4
A is the Grandparent and B is the parent and there are many Bs. Every of those Bs can have multiple Cs and every of those Cs are unique(only assigned to one B). My posts are not listed in A level or B level but in the C levels. There are many Bs and some of them have zero postings in the C level.
What I want to do is to list the categories in B level that has postings in the C level. For those Bs that has zero postings in C level, I would like to omit them.
Your code just now seems to do the omitting part right. Only those Bs with postings in their C levels are listed. However there seems to have some issues with the way the counter is counting as it seems to repeat some of the Bs multiple times, one after another.
Thanks so much.
Forum: Fixing WordPress
In reply to: List posts in sub-sub categories of a category.Thanks. It did hide the empty categories on C level. However the code seems to have some bugs. Some categories are repeating itself. Some repeat itself 2 or 3 times and some as much as 8 times one after another.
Another question I have is why does one category only produces 5 postings? Some of it has more than 20 postings. All have maximum 5 postings or lesser.
Thank you so much for your time.
Forum: Fixing WordPress
In reply to: List posts in sub-sub categories of a category.Thanks. I tried. It don’t work because this hide empty is referring to hiding the Bs but none of my posts are specifically had ticked any category on the Bs(parent) level but Cs. So when I set it at hide_empty=1, it returns nothing at all because technically no posts has ticked any categories on the parent level. All are ticked on the C level.