[closed] Customizing admin CSS (7 posts)

  1. leisegang
    Posted 3 years ago #

    I want to add some CSS code to the admin theme.
    If the color scheme is FRESH then i want to add some style. If not i want to use another CSS file.

    When doing a print_r($layout); it says classic ( i use that) but it adds the dark.css file.
    What am i doing wrong?

    function css_admin_head() {
    	global $user_ID;
    	$layout = get_user_meta($user_ID, 'admin_color', true);
    		if ($layout = 'fresh') {
    			echo '<link rel="stylesheet" type="text/css" href="' .plugins_url('dark.css', __FILE__). '">';
    		else {
    			echo '<link rel="stylesheet" type="text/css" href="' .plugins_url('light.css', __FILE__). '">';
    add_action('admin_head', 'css_admin_head');
  2. Moved to WP-Advanced (this isn't a Multisite thing, it's general WP)

    When doing a print_r($layout); it says classic ( i use that)

    What's the full output?

  3. leisegang
    Posted 3 years ago #

    This is the full output:
    <link rel="stylesheet" type="text/css" href="http://blogurl.net/wp-content/plugins/admin-theme/dark.css">

    And the print_r($layout); prints "classic" thats it.

    and if i enable the fresh layout on my user profile it prints "fresh". So that works.

    i think my "error" is: if ($layout = 'fresh')
    But i dont know what to type here.

  4. DigitalDesignDj
    Posted 3 years ago #

    your "error" is: if ($layout = 'fresh')

    if ($layout == 'fresh')

    PHP and JavaScript behave similarly:

  5. leisegang
    Posted 3 years ago #

    Thanks! That worked!

    Such an easy fix! Just a = too little!

  6. steadyone
    Posted 3 years ago #

    Okay I need helpppppppppp! I am trying to change the color of my menu fonts. I have looked through sop many codex pages my eyes are blurry. My CSS page is different to all the ones I see online that they are changing in the codex area. I have the these Portfolio Press theme.

    I want to be able to change the font size and color of the menu and body.

    Please help.

    Thanks signed frustrated.

  7. WPyogi
    Forum Moderator
    Posted 3 years ago #

    @steadyone - your question is not the same as this one - and this is not the right forum for it either. If you need help with Portfolio Press theme, please start a new thread here:

Topic Closed

This topic has been closed to new replies.

About this Topic