This members-only tutorial provides the steps to display a grid of subcategories (if present) or a grid of posts (if there are no subcategories) on category archive pages in Oxygen.

Step 1

Let's add a custom function using which we can check if a particular category has subcategories or not.

Install and activate Code Snippets plugin.

Go to Snippets > Add New.

Title: has_term_have_children()

Code:

This is a premium members-only content.

To view the rest of the content, please sign up for membership ($37/month or $399 one-time).

Already a member? Log in below or here.

Need help implementing a tutorial in your site or want to hire me for custom work?

HIRE ME

Find the article helpful and wish to donate?

DONATE

Comments

For adding code blocks wrap the code in three backticks. Markdown should work.
Provide a URL of your site/webpage if something is not working.

3 comments on “Subcategories Grid in Oxygen”

  1. Hi Sridhar, awesome tutorial. How could this work for the following use case?
    1. CPT taxonomy (say product_category)
    2. Instead of the Image plugin, an ACF field (category_featured_image applied to product_category)
    3. without the custom thumbnail (just native 300px)
    4. without the condition for showing posts if child categories not found (I’ll use a repeater)

    Would appreciate some pointers, since I tried a few things, but with my current (little) knowledge, it didn’t work

    1. Hi Joe,

      We would need to re-write the code and use different functions etc. to do what you want.

      You may want to ask in the Oxygen Facebook group to see if anyone is willing to help.

      You can contact me to get this done for a fees, if you wish.

magnifiercross
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram
%d bloggers like this: