How to override admin-bar style

You can override admin-bar with this function, don’t need to mess with admin-bar.css. Steps: Write your css Put inside the function (given below) Add this inside functions.php // customize admin bar css function override_admin_bar_css() { if ( is_admin_bar_showing() ) { ?> <style type=”text/css”> /* add your style here */ </style> <?php } } // on … Read more

Modify Admin Bar Link

I’ve not worked with the admin-bar before. However, I found your question interesting and decided to take a look. If you add a function to handle the action hook ‘admin_bar_menu’ and set the priority to be higher than 70, you will have access to the raw admin_bar_menu nodes where you can modify the properties you … Read more

Where and how to put inline js in pages

You can add inline js by using the wp_add_inline_script function. function prince_scripts() { wp_enqueue_script( ‘prince-script’, get_template_directory_uri(). ‘main.js’); $hide_on_mobile = apply_filters( ‘prince_hide_on_mobile’, true ); $data=”var hideOnMobile = ” . ( $hide_on_mobile ? ‘true’: ‘false’ ) . ‘;’; wp_add_inline_script( ‘prince-script’, $data, ‘before’ ); } add_action( ‘wp_enqueue_scripts’, ‘prince_scripts’);

Relative URLs and hide /wp-content/themes/

The easiest way to move your theme folder is only via constant; include the wp-content folder. You can set a constant for the plugin folder and wp-content folder. Then is your plugins and themes in separete url, also in the include in the source of the frontend. like this example for my dev installs: define( … Read more

functions.php inject inline css

The easiest way I’ve seen is to echo it where you need it: function inline_css() { echo “<style>html{background-color:#001337}</style>”; } add_action( ‘wp_head’, ‘inline_css’, 0 ); Since 2019 you can also add styles inline inside the body, shown here without using echo: function example_body_open () { ?> <style> html { background-color: #B4D455; } </style> <?php } add_action( … Read more