Skip Navigation

[Resuelto] How to disable the dynamic CSS and JS files from Layouts?

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

Problem:
Layouts enqueues dynamic files for its custom CSS and custom JS, how can they be disabled?

Solution:
You can add the following code to your theme's functions.php file:

// dequeue Layouts dynamic style for Template Layouts
add_filter('wp_enqueue_scripts', function(){
    wp_dequeue_style( 'wp_ddl_layout_fe_css' );
 
}, 1000);
// dequeue Layouts dynamic script for Content Layouts
add_action('get_header', function(){
    wp_dequeue_script( 'wp_ddl_layout_fe_js' );
}, 11);
// dequeue Layouts dynamic style for Content Layouts and Script for Template Layout
add_filter('get_layout_id_for_render', function( $id, $args ){
    wp_dequeue_style( 'wp_ddl_layout_fe_css' );
    wp_dequeue_script( 'wp_ddl_layout_fe_js' );
    return $id;
}, 1000, 2);
This support ticket is created hace 6 años, 6 meses. 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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Este tema contiene 2 respuestas, tiene 2 mensajes.

Última actualización por atsushiK hace 6 años, 6 meses.

Asistido por: Nigel.

Autor
Mensajes
#902721
403error.fw.png

Hello

I got javascript 403error in chrome console.

I found similar post in here.
https://toolset.com/forums/topic/issue-neterr_aborted-and-403-forbidden/

According to this post, I delete all javascript and css from Layouts CSS and JS Editor.
But I still have an error message.
If it possible I don't want to change directory permission.

Is there any solution for this problem?
thank you.

#902804

Nigel
Supporter

Idiomas: Inglés (English ) Español (Español )

Zona horaria: Europe/London (GMT+00:00)

Hi there

If you are unable to resolve the permissions issue then you can disable using the dynamic CSS and JS files for Layouts by adding the following code to your theme's functions.php file (or using a plugin such as Code Snippets):

// dequeue Layouts dynamic style for Template Layouts
add_filter('wp_enqueue_scripts', function(){
    wp_dequeue_style( 'wp_ddl_layout_fe_css' );

}, 1000);
// dequeue Layouts dynamic script for Content Layouts
add_action('get_header', function(){
    wp_dequeue_script( 'wp_ddl_layout_fe_js' );
}, 11);
// dequeue Layouts dynamic style for Content Layouts and Script for Template Layout
add_filter('get_layout_id_for_render', function( $id, $args ){
    wp_dequeue_style( 'wp_ddl_layout_fe_css' );
    wp_dequeue_script( 'wp_ddl_layout_fe_js' );
    return $id;
}, 1000, 2);
#903379

I could correct the error according to your advice.
thank you.