Custom admin bar css on front end bug

You make it the wrong way. First, you do double work. Enqueue inside enqueue. You don’t need wp_enqueue_scripts(): wp_enqueue_style( ‘color-admin-bar’, PATH_TO_CSS, array( ‘admin-bar’ ) ); Second. Don’t use anonymous functions with WordPress Actions. Once-for-all-time is OK, but while the project is growing up you can collide with the inability to dequeue that style when you’ll … Read more

CSS not showing up in my website Only HTML Displaying

Check you are addressing the CSS file correctly. How is it being called? The url should be along the lines of ht|tp://yoursite.com/wordpress/wp-content/themes/yourtheme/style.css you’ll find somewhere that it’s loading as ht|tp://localhost/and so it will load correctly on your machine but not on anyone else’s. Have a look in Developer Tools for the URL of style.css

How do I show a button only on my custom template page?

It’s as simple as doing a conditional and check if you are on home. What you are looking for is is_page_template( );. Wrap your button inside it as follows: <?php if( is_page_template( ‘your-template-slug.php’ ) ){ ?> <button name=”button” style=” … ” value=”OK” type=”button”>HAVE A QUESTIONS</button> <?php } ?>

Should I use `get_stylesheet_uri()` or `get_template_directory_uri()` when calling my CSS Stylesheet?

WordPress recommends the proper way to enqueue the main style is the method-A. Please see the WordPress theme development handbook here (though both methods will work). https://developer.wordpress.org/themes/basics/including-css-javascript/ It’s not clear to me why you want to link the two .css file? You can create custom .css file and enqueue it using method-B. However, if you … Read more

Menu Underline shows without Hover after adding subitems

.nav-menu .current-menu-ancestor > a {text-decoration:none} will help. Alternatively, use .nav-menu .current-menu-ancestor > a {text-decoration:none !important;}. Please change the .nav-menu with the class name that you have used Please let me know if it works.

custom css in admin panel by user id

Use below code into functions.php file. Make sure you are using it right way use admin_enqueue_scripts add_action(‘admin_enqueue_scripts’, ‘FUNCTION_NAME’);function FUNCTION_NAME() { global $current_user; $user_id = get_current_user_id(); if(is_admin() && $user_id == ‘2’){ wp_enqueue_style( ‘admin_css’, get_template_directory_uri() . ‘/admin-style.css’, false, ‘1.0.0’ ); }}

Child theme after CSS modification

As Jacob Peattie mentioned, you’ve made custom CSS changes in a way that does not impact your theme. To expand a bit more, this is the only place you can make changes that will persist through a theme update or change. All other customizations get wiped. So if you find you want to make further … Read more

How to NOT override inline css rules

Please see this post about including styles and scripts correctly. As far as I can see, you are just throwing in the style.css, giving WordPress not the opportunity to decide, which stylesheet comes when. In order to do that, you need to register your style first, then WordPress can decide according to your priority, where … Read more