Skip Navigation

[Resolved] Elemontor team says that has_archive is not true for some reason

This support ticket is created 5 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Tagged: 

This topic contains 8 replies, has 2 voices.

Last updated by Beda 5 years, 2 months ago.

Assisted by: Beda.

Author
Posts
#1328533

Good morning.

.Shane was on this issue, so I don't know if he should continue with it or if someone else can work on it.
It doesn't really matter. I just would like to get a solution. This is the link to the ticket that is now marked as resolved - https://toolset.com/forums/topic/elementor-templates-dont-work-when-toolset-is-active/
But ...
...we thought that the issue for custom post type templates being created with elemontor was something in their code, but it seems that it might be something in toolset.

Here is there reply to me via email:
************************************************************************************
Usman replied
Aug 31, 5:04
Hi Michelle,

Thank you for your response and the logins.

I tried creating an archive page and it's working fine for me ;

hidden link

What happened is, some archives are not working because the code or custom post type used in those pages are not getting supported with Elementor Editor for some reason. has_archive has to be true in the code or plugin settings you may have used so it's editable, Can you reach out to third-party code/plugin authors to resolve this since we have no control over their products?

Or I would advise you to use existing posts which can help you get this one.

Let me know if you have any questions.
Have a good day Michelle!
************************************************************************

I don't know how else to get this solved but to know on the tech teams door.

#1328657

I frankly do not understand Elementor's statement here.
I get that the Post type must have has_archive true if it needs archives, that can be edited in the very post type edit screen on Toolset Types (Toolset > Post Type > Edit > has_archive).
However, that's not a BUG or similar, it's a simple matter of fact that WordPress offers when registering post types.

All Post Types have that set true by default and it can be altered in each post types' settings

Further, following the comment

What happened is, some archives are not working because the code or custom post type used in those pages are not getting supported with Elementor Editor for some reason. has_archive has to be true in the code or plugin settings you may have used so it's editable, Can you reach out to third-party code/plugin authors to resolve this since we have no control over their products?

Or I would advise you to use existing posts which can help you get this one.

What does that refer to?
- What happened is, some archives are not working because the code or custom post type used in those pages are not getting supported with Elementor Editor for some reason
Archives and pages are not the same things, and there is nothing specific to add "Elementor" support anywhere. Best to know why Elementor support isn't working would be Elementor. I am surprised they do not know what Elementor expects to be working. I am sure, it expects nothing more but native Post Types, as I use Elementor quite often and can tell it works just fine also with Toolset. I am surprised about this, likely I do misunderstand the sentence?

- has_archive has to be true in the code or plugin settings you may have used so it's editable
Again I have a little difficulties understanding, I am not sure what should be "editable" and where, but if Elementor expects has_archive true for the post type, then you can simply set that in Toolset > Post Types. I can, however, assure you that's not the case - at least not for single posts. Maybe for archives, but again, it is the default setting of all post types. I am not sure if you eventually changed that in Toolset Post Types? Then I suggest trying what Elementor suggests and add has_archive.
What this does is merely add support for the post type to appear in an archive. It doesn't make it editable with other plugins, per se.

- Can you reach out to third-party code/plugin authors to resolve this since we have no control over their products
I again do not understand how the 3rd party shhould help define why Elementor is not working.

I might misunderstand the scope here, if this is only about checking how to get a post type to have has_archive true, then you can do that in Toolset > Post Types > Edit > Options.

I however rather suspect the reason behind the issue here is Elementor being used on Archives that have already a WordPress archive assigned by Toolset in Toolset > WordPress Archives, or eventually have Content Templates assigned in their single posts, or Elementor template, but displaying in an Archive of Toolset.
Elementor is not supposed to be used on any View or Archive if created by Toolset, as you state to understand, looking at your previous interaction with Shane (you mention exactly this at the very beginning of your thread).

There I see that the issue you refer is purely related to Elementor, which when trying to create an archive and single page template for the Post Type in question, does not open unless you click on the safe mode.
Even if the editor screen opens, you can't click on anything. Nothing works.

That is easily confirmed to be either a toolset or Elementor issue by adding a Custom Post type using hidden link to your site.
Can you do with Elementor what you expect to do, on that post type?
If yes, the issue is in Toolset. If not, then the problem is in Elementor.

Concluding I suggest:

- ensure as Elementor says to be required that has_archive is active on the post types
- ensure there are no Toolset Archives or Content Templates assigned to these posts
- if all this does not work, maybe a copy of this site would help me.

I activate for this purpose the next private reply.

Thanks!

#1330169

I can't log in to this duplicate, most likely WordPress native access was customized?
It always redirects me to the front end login screen, and I cannot access any site or page in the backend.

Not even disabling all plugins thru FTP did help. Only removing the Theme helped.
After logging, I received a ERR_EMPTY_RESPONSE, which is not solvable.

On your live site instead, I can log in, and see that the only 2 post types you have created with Toolset have has_archive set to true.
1. hidden link > has_archive
2. hidden link > has_archive

You have no Archives created by Toolset:
hidden link

That's ok, this means they will not interfere, as there is nothing to interfere with (no Toolset Archives)

In Elementor I see you built 3 templates hidden link, but none of them seems applied to an archive, to me.

Can you elaborate where precisely the issue is visible in the front end and where you edit that in the backend?
Can you also let me know what the tests proposed in https://toolset.com/forums/topic/elemontor-team-says-that-has_archive-is-not-true-for-some-reason/#post-1328657 produce? (related to other post types, not created by Toolset)

I can then have another look.

#1330281

Hey, Beda.

I have removed all single.php and archive.php created with toolsets. I have deleted the cpt how to's and tried adding it via a code snippet. That did not solved the problem either. So I made a video to show you what I am doing.

hidden link

It is very weird that only that post type would not work.

#1330311
Bildschirmfoto 2019-09-03 um 17.13.15.png

As said, there where no Archives created by Toolset, there can be none to be removed, accordingly.
I don't understand why you removed the How To's Custom Post Type, but I suspect now this is the Post Type with which you experience issues? I however never indicated to remove the post type. It's not required, as I mention, it supports archives, has no archive assigned, and hence nothing can and will display on that archive.
At least, not using Toolset.

I cannot see the archive you created for it using Elementor, as I explained, and without that, I can also not confirm what the issue actually is.

I also see in your video, you create a Post Type How to, after deactivating a Custom Code that actually registers it.
But then you never create either template nor archive in Elementor for it, instead, for a different post type.

I will try to elaborate on how to use Toolset and Elementor.

1. You do not need any PHP files created on your own. You can simply use any theme that follows the WordPress codex
2. You can design single posts and templates with Elementor. Do not design anything with Toolset, in this case.
3. Or, you can design single posts and templates with Toolset. Do not design anything with Elementor in this case.
4. In both cases, you can create post types with Toolset, or Custom Code, but please do not mix those. There is no reason to switch between custom code and Toolset.

Concluding, obviously has_archive is not the issue here, as you confirmed as well, as we see also in your last reply and video.
I was unfortunately not able to see the ending of the video, as it seems to interrupt around the middle, and see now some archives with Elementor here hidden link
There is also the how to's post type now.

The post type here is the same hidden link, so use only either-or, that is correct.

How To’s Archive Page of elementor is a draft, can hence not apply.
When I want to edit it what you see in the screenshot appears.
Is this the problem you are facing?

I need a working copy of this site to debug that.
Or we try on a staging site if you have one.

Could you provide either on in the next reply so I can assist you in the best way possible?

#1331193

I deployed the package, but the installer and zipped package were not from the same duplication process.

In place of the required 20190902_sajobboard_6188190603f599c74660_20190903164930_archive.zip, I received a 20190902_sajobboard_73d476e489a2be833413_20190902122809_archive.zip file, which then threw errors even if corrected to the expected name.

I was able to extract the original Installer file from the ZIP and deployed that.
This time, the login worked, as opposed to the last Duplicate.

After logging in, I head to wp-admin/edit.php?post_type=elementor_library&tabs_group=theme&elementor_library_type=archive, published the one archive for How To's posts (with the quickedit option) and then edited it.
That presented the precise same issue as I see in your screenshot.

The toolset was not even used at this point, since the Post Type is added as Custom Code, in wp-admin/admin.php?page=edit-snippet&id=5

But note, that is not the correct way of adding Custom Post Types.
You run that code only in the backend, but Post Types also are on the front end, they are everywhere, in fact.

So far, the issue is not related to Toolset.
You can fully disable Toolset, and the issue will still happen.
This is an issue between your code and Elementor, which I cannot help to resolve here.

Now, I also deactivated your Custom Code and activated Toolset, so to create the How To's Post with Toolset.
The same issue happened there with the Template in question.

Then I recognized, the template of Elementor is not even assigned to this Post Type.
So the issue is actually not the post type, but the Template.

In fact, you can easily create a new Template for the Archive for Elementor, following their documentation and GUI.
You will add a new template, choose to create an ARCHIVE when adding one, then as condition the How To's Archive, and save that.
This works perfectly fine locally.

I suggest creating a new template, for the archive, as simply the existing one seems corrupt, which we did not notice before I think neither us and Elementor.

If creating a new template for archives does not work on your end it might be because of errors I saw in your process, while watching the video.
You need to choose to create an ARCHIVE, in the begin, then edit it and then as condition, when saving it, add the proper archive.
Instead, you create single templates, as I see in the video, and that won't help to create archives.

To create a single template, it also works just fine, but you need to follow the Single Template workflow when creating it with Elementor.
I tested this on the duplicate received, where this all worked, in new template(s)

#1331341

Hey, Beda.

Thanks for all your help. I have contacted the elementor team. I am still not getting your results but anyhow. If all goes well the issue might be solved soon.
Ps: I did go through elementor documentation and tried to do it the way they show, but how to's won't work no matter what.

#1331345

Let's hope elementor can solve this. Thank you!

#1331351

The issue is - as you reported it - not related to Toolset, and probably not even Elementor, but a wrong setup of the original template.
If the template is set up as elaborated above (Elementor Support can help with precise detailed steps) it works on the duplicate provided.

Should I set up an example for you on your site?