How to create element condition for Archive being viewed?

I’m trying to figure out how to make an element visible if it is not on an archive layout. There is a condition for “All Archives”, but there isn’t a condition for “Archives not being viewed”.

Any idea how I can add a condition for an Archive page not being viewed?

Hello @OctoCog,

Thanks for writing to us.

You can’t directly set a condition for “archives not being viewed,” but you can achieve this by setting these conditions:Post Type is Page. The element will render only the pages, not the archives pages.

Hope it helps
Thanks

@prakash_s I set this, but it did not work for my context. I need an element in this component to be visible on single post layouts, but not on archive layouts.

Hey @OctoCog,

We’re sorry for the confusion. Setting the condition “Post Type is Page” will not work correctly for this purpose because:

  1. It excludes other single views: It will hide the element on single blog posts, custom post type detail pages (like portfolio items or WooCommerce products), and 404 pages, even though those are not archive pages.
  2. It can conflict with special pages: For example, the main Blog page is technically a WordPress “Page” in the backend, but it functions as an archive layout (is_home()).

The only way for an element to be visible on any non-archive page for now is by custom development which is regretfully outside the scope of our theme support. What we can do is list this case as a feature request. If you need this feature now, we can guide you how to achieve this through our One service.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.