Why I can’t add a CSS style in this WordPress theme?

You are using plugins_url – therefore pointing to completly different directory than your current theme. If you are just trying to enqueue a theme style do it like this: function load_theme_styles() { wp_enqueue_style(‘main-css’, get_template_directory_uri() . ‘/style.css’, array(), ‘1.0’, ‘all’); } add_action(‘wp_enqueue_scripts’, ‘load_theme_styles’); the wp_enqueue_style takes some parameters. In the example above I am using: A … Read more

how to include other plugins css files in a shortcode?

I think you could get around this by pre-running the shortcodes on the page by applying the content filters before the header is output. This should allow any internal shortcodes run inside the included post to add any action hooks properly and thus any needed stylesheets/resources. add_action(‘wp_loaded’,’maybe_prerun_shortcodes’); function maybe_prerun_shortcodes() { if (is_page()) { global $post; … Read more

Remove wp_add_inline_style

Remove styles added with wp_add_inline_style() If we want to keep the custom-style-css but only remove the custom-style-inline-css, then we can try e.g. add_action( ‘wp_print_styles’, function() { // Remove previous inline style wp_styles()->add_data( ‘custom-style’, ‘after’, ” ); } ); where after is data key for the inline style corresponding to the custom-style handler. There is exists … Read more

wp_enqueue_style for Plugin with multiple stylesheets

To answer your first question, you would use the second style, i.e. function add_my_stylesheet() { wp_enqueue_style( ‘myCSS’, plugins_url( ‘/css/myCSS.css’, __FILE__ ) ); wp_enqueue_style( ‘myCSS1’, plugins_url( ‘/css/myCSS1.css’, __FILE__ ) ); } add_action(‘admin_print_styles’, ‘add_my_stylesheet’); What the add_action() function does is tell WordPress, “When the admin_print_styles action occurs, run this add_my_stylesheet() function.” Confusingly, the practice of using the … Read more

Get list of scripts / styles and show file which enqueued them

This is not possible the way you think. It would maybe be possible if you use Reflections or debug_backtrace(), but there’s no reliable way to do this. WordPress does not keep a stack or queue where it tracks file names. The only thing I could imagine is just hooking into the action and inside wp_enqueue_scripts(): … Read more

Load js/css files only on specific admin UI pages

The right hooks // Use both for scripts & styles *) wp_enqueue_scripts // (for the frontend) login_enqueue_scripts // (for the login screen) admin_enqueue_scripts // (for the admin dashboard) *) Read this article @wpdevel. Further reading in the Codex about the three hooks admin_menu network_admin_menu user_admin_menu On the admin_enqueue_scripts hook, you have an argument as well: … Read more

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