How to use parent theme’s enqueue methods

If the desired functions are in the parent theme’s functions.php then you can include them in your currently executing child theme functions.php with this call: include( get_template_directory() . ‘/functions.php’); get_template_directory() finds the parent’s directory even when using a child theme. Note that this will run everything found to be executable in the parent theme’s functions.php. … Read more

Add `datetimepicker` to form

You can try this. add_action( ‘wp_enqueue_scripts’, ‘wpcustom_enqueue_script’ ); function wpcustom_enqueue_script() { wp_enqueue_style( ‘datepicker-style’, ‘https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css’ ); wp_enqueue_script( ‘js-datepicker’, ‘https://code.jquery.com/ui/1.12.1/jquery-ui.js’, array(‘jquery’), null, true); } Readmore: http://jqueryui.com/datepicker/

Adding customizer styles with wp_add_inline_style

You can try to detect if the current used theme is a child and if so pointing the inline CSS to the right style. I didn’t tested this solution but could be a good starting point. function mytheme_enqueue_style() { wp_enqueue_style( ‘parent-theme-style’,get_template_directory_uri() . ‘/style.css’, false ); if(is_child_theme()) { wp_enqueue_style( ‘child-theme-style’, get_stylesheet_directory_uri() . ‘/style.css’, array(‘parent-theme-style’) ); } … Read more

Get the list of enqueued/registered scripts for a specific post?

I’m not familiar with Gutenberg, but as you mentioned it as an example, I assume you didn’t mean “only” Gutenberg. The wp_enqeue_script() or wp_enqueue_style() functions do not accept arguments regarding posts or pages. The script are registered and rendered globally. If a script is output on certain posts only, then it has to be a … Read more

Remove inline css added by wp_add_inline_css

If wp_add_inline_css is fired within an action you can use remove_action with the same parameters. You also might use wp_enqueue_scripts action to dequeue any scripts or styles in a proper way. But, inline style are not included in the $wp_styles global, you can unset them with the action print_styles_array, you need to know the handle … Read more

Duplicated CSS files using wp_enqueue_style()

Naming conventions for scripts and styles have always been a difficult issue in WordPress plugins, with many different conventions used and often causing conflicts. I’ll try to give my view on this matter, and elaborate where necessary. Let me start off by stating my opinion on the example in your question: in my opinion, only … Read more

Enqueue a css using negative conditional tags

The bug’s only 4 years old so you wouldn’t want to rush them would you?! A workaround is to leave out the wp_style_add_data() and use the ‘style_loader_tag’ filter: add_filter( ‘style_loader_tag’, function ( $tag, $handle ) { if ( $handle == ‘purecss-all-not-ie’ ) { $tag = “<!–[if gt IE 8]><!–>\n” . $tag . “<!–<![endif]–>\n”; } return … Read more

Hyphens vs. periods in the script slug in wp_register_script?

Use hyphens only. Take a look at wp-includes/script-loader.php: $scripts->add( ‘scriptaculous-sound’, ‘/wp-in $scripts->add( ‘scriptaculous-controls’, ‘/wp $scripts->add( ‘scriptaculous’, ”, array(‘sc // not used in core, replaced by Jcrop.js $scripts->add( ‘cropper’, ‘/wp-includes/js/cr $scripts->add( ‘jquery’, ‘/wp-includes/js/jqu // full jQuery UI $scripts->add( ‘jquery-ui-core’, ‘/wp-include $scripts->add( ‘jquery-effects-core’, ‘/wp-in $scripts->add( ‘jquery-effects-blind’, ‘/wp-i $scripts->add( ‘jquery-effects-bounce’, ‘/wp- $scripts->add( ‘jquery-effects-clip’, ‘/wp-in $scripts->add( ‘jquery-effects-drop’, ‘/wp-in $scripts->add( … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)