There is code to connect stylesheets and scripts from header to footer for optimization.
function footer_enqueue_scripts(){ remove_action('wp_head','wp_print_scripts'); remove_action('wp_head','wp_print_head_scripts',9); remove_action('wp_head','wp_enqueue_scripts',1); add_action('wp_footer','wp_print_scripts',5); add_action('wp_footer','wp_enqueue_scripts',5); add_action('wp_footer','wp_print_head_scripts',5); } add_action('after_setup_theme','footer_enqueue_scripts');
Tell me how you can exclude from this transfer any one style registered with wp_enqueue_style("dfd_header_builder_front", $path);
those. so that not all styles are transferred to the footer.
Is it possible to somehow form an array and remove one style from it so that it remains in the header?
PS
class WPBakeryShortCode_Dfd_User_Form extends WPBakeryShortCode { public function __construct($settings) { wp_enqueue_script("jquery-ui-datepicker"); wp_enqueue_style("dfd_datepicker", DFD_EXTENSIONS_PLUGIN_URL . "vc_custom/user_form/assets/css/datepicker/datepicker.min.css");
functions.php
function dequeue_dfd() { wp_dequeue_style( 'dfd_datepicker' ); } add_action( 'wp_enqueue_scripts', 'dequeue_dfd', PHP_INT_MAX );
ΠΠΎΠΆΠ½ΠΎ Π»ΠΈ ΠΊΠ°ΠΊ-ΡΠΎ ΡΡΠΎΡΠΌΠΈΡΠΎΠ²Π°ΡΡ ΠΌΠ°ΡΡΠΈΠ²
- KAGG DesignΠΠ°Π·Π²Π°Π½ΠΈΠ΅ ΡΠΊΡΠΈΠΏΡΠ° (ΡΠ°Π±ΠΎΡΠ΅Π΅ Π½Π°Π·Π²Π°Π½ΠΈΠ΅). Π‘ΡΡΠΎΠΊΠ° Π² Π½ΠΈΠΆΠ½Π΅ΠΌ ΡΠ΅Π³ΠΈΡΡΡΠ΅.
ΠΠ°Π·Π²Π°Π½ΠΈΠ΅ ΡΠΊΡΠΈΠΏΡΠ° (ΡΠ°Π±ΠΎΡΠ΅Π΅ Π½Π°Π·Π²Π°Π½ΠΈΠ΅). Π‘ΡΡΠΎΠΊΠ° Π² Π½ΠΈΠΆΠ½Π΅ΠΌ ΡΠ΅Π³ΠΈΡΡΡΠ΅.
i.e. first argument towp_enqueue_script
, wp_enqueue_script ('newscript', get_template_directory_uri (). '/js/custom_script.js'); Well, if without this array of names, how can you then leave one style in theheader
, using the above codeadd_action('after_setup_theme','footer_enqueue_scripts');
? - wordwp_enqueue_style
ΠΠ°Π·Π²Π°Π½ΠΈΠ΅ ΡΠ°ΠΉΠ»Π° ΡΡΠΈΠ»Π΅ΠΉ (ΠΈΠ΄Π΅Π½ΡΠΈΡΠΈΠΊΠ°ΡΠΎΡ)
, i.e. I'm talking about an array of such names - word