Why are my frontend theme styles bleeding into the backend?

You’re supposed to enqueue on the wp_enqueue_scripts event. Placing the function in functions.php and immediately running it, will make it run on all pages, including the admin area Here’s an example from the devhub: /** * Proper way to enqueue scripts and styles. */ function wpdocs_theme_name_scripts() { wp_enqueue_style( ‘style-name’, get_stylesheet_uri() ); wp_enqueue_script( ‘script-name’, get_template_directory_uri() . … Read more

How to change DASH-ICON color with CSS?

Yes, this is possible. Make sure your CSS selector is correct. You can target the specific HTML element or its ::before pseudo element and change colour with CSS. Can you post your HTML snippet of the element you want to change and the CSS selector you are using? Maybe you mean to change the colour … Read more

Where is this inline CSS code [closed]

The CSS code you’re seeing is added by core of WP when admin bar is showing. The function that outputs it is called _admin_bar_bump_cb() and it’s called as hook on wp_head. So how to get rid of it? Just remove this action from that hook: function remove_admin_bar_bump() { remove_action( ‘wp_head’, ‘_admin_bar_bump_cb’ ); } add_action(‘get_header’, ‘remove_admin_bar_bump’); … Read more

Where is definied the theme location for the main menu in a WordPress template?

Menu locations are defined in functions.php You can read the codex for more information on how to define menu locations in functions.php Register Menus Firstly, in your theme’s functions.php, you need to write a function to register the names of your menus. (This is how they will appear in the Appearance -> Menus admin screen.) … Read more

Styling Custom Meta Boxes?

Remove the wp_enqueue_style line from the above code and replace it with this: add_action( ‘admin_print_styles-post-new.php’, ‘portfolio_admin_style’, 11 ); add_action( ‘admin_print_styles-post.php’, ‘portfolio_admin_style’, 11 ); function portfolio_admin_style() { global $post_type; if( ‘portfolio’ == $post_type ) wp_enqueue_style( ‘portfolio-admin-style’, get_stylesheet_directory_uri() . ‘/css/portfolio-admin.css’ ); } It is better to put the styling for the admin panel in a separate file … Read more

How should I best target dynamically served content?

I think it depends on whether you want it to be unique for each of the four “highlighted” project columns on the homepage, or whether you want each “highlighted project” to be different. Does that make sense? E.g. if you just want each of the four project “columns” on the homepage to look different then … Read more