the answer for all question about Oxygen Builder plugin and WordPress

Looking for the best way to set conditions here.

Looking for the best way to set conditions here.

I have a CPT with custom taxonomy for its categories. Categories are like:
> sub1
> sub2
> sub3
> > sub4
> sub5

I have an Oxygen template that shows a list of posts for each sub category. Everything works fine up to this point.
The problem is they recently added sub4, a subcategory under a subcategory. We want this to appear as a section on the page that shows the posts from sub3.
I am simply using a repeater to show the posts.

I have set up another repeater to show the sub-sub category, but am having a hard time making sure this only shows up when a sub-sub category exists in the first place.

On my post listing template, I need to be able to detect if the current taxonomy shown has a subcategory of its own, and if so, show the posts from this in another section at the bottom of the page under the main listing of posts.

I have created the 2nd repeater, and a header at the top, but can’t figure out a proper conditional for when to show them or not.

So far I have created a “Dynamic Data” conditional with this code:
Function: get_term_children
Arguments: get_queried_object_id(), “cpt_categories”

This will actually return an array of IDs, or a blank array if it has no sub categories. This is fine, but the rest of the Oxygen conditional screen doesn’t make sense. The is_blank and is_not_blank don’t seem to work for arrays. So I can also try “contains” or “does_not_contain”, but what would I use as the value since it doesn’t really matter what it contains, I just need to know if anything is in there!
There is no “count” condition I can use on the array, and I don’t think the other arithmetic operations will work either. So how do I use this array of IDs as my conditional? I only want to check if any sub-category exists under the current category being viewed.

Hope that makes sense!


Leave A Reply

Your email address will not be published.

Oxyrealm Docs