- This topic has 20 replies, 2 voices, and was last updated 3 years, 6 months ago by
John.
-
AuthorPosts
-
October 9, 2022 at 5:08 pm #2368184
Fernando Customer Support
Oh I see. Glad that works! Thank you for sharing!
October 13, 2022 at 11:26 am #2372678John
I’m revisiting this topic. I have been using custom fields with ACF to display icons as I wanted, but now that I’ve read another support post and see that I can use CSS to style category labels individually, I’m one step closer to being able to use categories.
I’d prefer categories over custom fields because, well, my criteria are in fact categories, and categories have features I’d like to use (e.g. click on the category label, and see all other posts with that category, etc).
My only issue remaining (I hope!) is that I need to display only category labels that are under a specific parent category parent. I also have other categories on each page, under another parent categories, which labels I don’t want to display. How can I achieve that?
Note: I have GP Pro and also GB Pro now
October 13, 2022 at 10:21 pm #2372991Fernando Customer Support
Hi John,
If that’s the case, you might need to inject those categories manually through code?
Will you be doing this for one Parent Category?
Example code we might need: https://wordpress.stackexchange.com/questions/31646/how-to-get-child-categories-of-a-given-post#:~:text=To-,get%20the%20child%20categories,-of%20a%20given
October 13, 2022 at 10:40 pm #2372995John
Fernando, is it code I would inject with Code Snippet for example?
October 13, 2022 at 11:24 pm #2373017Fernando Customer Support
Yes, it is.
October 14, 2022 at 12:24 am #2373060John
Ok. To your question, my posts may have multiple categories, but only some of them are relevant to display in my specific use case. The relevant ones are all under the same grand-parent category, under different parent categories. Like this: https://i.imgur.com/Z6btnpi.png
Although I can get rid of the extra layer of ‘parent’ categories if it makes things much simpler. They exist mostly for my own convenience of grouping categories together.
I hope that makes sense.
I looked at the code on stackexchange, but I’m afraid I’m not proficient enough in PHP to understand it well. I’m not sure which option presented I should use. Let alone how to display it in my post template. Would you mind telling me?
-
AuthorPosts
- You must be logged in to reply to this topic.