Skip Navigation

[Resolved] Unable to create archive templates

This thread is resolved. Here is a description of the problem and solution.

Problem:
The user was unable to create or edit an archive template.

Solution:
It turns out to be a Javascript issue caused by the Polylang plugin's code. Use the custom code in this reply to exclude Polylang's files from the archive template editor screen. https://toolset.com/forums/topic/unable-to-create-archive-templates/#post-1989291

0% of people find this useful.

This support ticket is created 3 years, 11 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
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 7 replies, has 2 voices.

Last updated by igorL-3 3 years, 10 months ago.

Assisted by: Jamal.

Author
Posts
#1987087

Hello,
Thank you for that. The small change to save 0 has helped. But now I have a paralell problem that may be related. When I try to create an Archive, on any custom post, instead of giving me an editor page I get a black page. Is there another flag, similar to the checkbox, I need to select. It's just a black page no error message of any kind

#1987099

It seems to me like a compatibility issue. Please check if this issue appears when:
- Only Toolset plugins are activated. It will tell us if there is an interaction issue with another plugin.
- The theme is set to a WordPress default like Twenty Twenty. It will tell us if there is an interaction issue with your theme.
If the problem disappears, start activating one at a time to track where the incompatibility is produced.

If this does not help find the cause of the issue, allow me temporary access to check your site. Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **

Let me know if it is fine with you to take a copy of your website if this needs further debugging.

#1987329

The conflicting plugin is Polylang. If I Diactivate it I get to the editor page. But I need that plugin as the site needs to have severla language version. What can I do?

#1987625

Well, I would suggest switching to our plugin WPML 🙂

But, If you prefer working with Polylang, please install it on this test site and if the issue is reproduced, we can assume it is a general compatibility bug, and I'll escalate it to our compatibility team. hidden link

If the issue is not reproduced, it is probably just an exception that occurs on your website, we'll need a copy of your website to debug it further.

#1987721

Hi,

I'm using the free version of Polulang as I don't need all the extra features. If there was an equalavent WPML I'd switch

I've uploaded the Polylang and added the languages I use on my site and the issue did reproduce with the only post type avalible to generate archives.

#1987737

I can see the issue. I'll try to find a workaround for it. I'll also approach our 2nd Tier for a second evaluation of the issue.

This may take some time, I'll get back to you as soon as possible.

#1989291

Hello again,

Our 2nd Tier has produced a custom code that will dequeue Polylang Javascript files inside the WordPress archive editor and Toolset forms. Add the following code to your theme's functions.php file or as a snippet in Toolset->Settings->Custom code:

/**
 * Dequeue polylang assets on Toolset admin pages
 */
add_action( 'admin_enqueue_scripts', 'ts_dequeue_pll_assets' );
function ts_dequeue_pll_assets(){
 
    if ( defined( 'POLYLANG_VERSION' ) && is_admin() )
    {
        $screen = get_current_screen();
 
        if ( in_array( $screen->id, array( 'wpa-helper', 'view-template', 'cred-form' ) ) )
        {
            wp_dequeue_script( 'pll_block-editor' );
        }
    }
}

Check it in the test site here hidden link
The archive editor is working as expected hidden link

Make sure the snippet is active for WordPress admin. hidden link
Reload the snippets page two times to make sure the snippet is active.

#1989313

It worked. Thank you Jamal!!!