Site logo

Archived topic

Issue with display rules

5 replies · Started by Fabien on September 17, 2020

Viewing posts 1–6 of 6

Hi,

I believe there is a small issue when using Elements and the display rules.

Let's say you have a CPT : Product - You don't want an archive page for this CPT (cf. has_archive = false)
Then you attach a Custom Taxonomy : product_cat

--> You are unable to find the archive for the custom taxonomy in the display rules. In order to see it, you need to change has_archive to true for the CPT. But it doesn't make sense as you can have has_archive = false for the CPT but you still have archive for the custom tax.

Let me know if you have any questions,

Fabien

Hi there,

Thats correct - Display Rules will only show archives that exist. Without an archive there is no template to tag. You should still be able to target the Single CPT Category though.

Nope, it didn't work, there was no option to target my tax archive (cf. is_tax()) that is existing... I needed to enable the archive at the CPT level to be able to target the tax archive.

I'm not sure if this is how archives in CPTs/custom taxonomies work.

If you set has_archive to false for the CPT, are you able to load the taxonomy archive that's attached to that CPT on the frontend?

Yes definitely (exemple in the private information, the CPT has_archive set to false, the page you see is an archive of the custom tax attached to the CPT).

That is using the default post category taxonomy and arhive.
So for the example given you could use:

Single Post: Post Category > Banque Pro
Archive: Post Category Archive > Banque Pro

This archived topic is closed to new replies.