Feb
18
2011

Add Logo to Admin WordPress Plugin

by   |  Posted in Downloads  |  110 comments

I have revamped my first plugin to make it a little easier to use. If you have tried it before and weren’t impressed, please give it another go. I’ve included an image uploader so you can easily add your own logo and choose whether you want it to appear in your wp-admin and/or the Login page. You also have the ability to upload multiple logos and then select which one you would like to use.

Any feedback or suggestions would be totally appreciated.

addlogo

This plugin has been updated for WordPress 3.3.

About the author:

A freelance web developer living in Montreal who spends most of his time writing for this site and building Premium themes for WordPress. You can find him on Twitter @bavotasan.

Site5 Affiliate Link
Share the love...
If you require help or support, please visit the Support Forum and ask all your questions there. Questions about themes or plugins posted in the comments below will not be answered.

Tags: , , , , , , , ,

Short URL: http://bit.ly/cQ6Pa0

Discussion 110 Comments

  1. c.bavota on February 26, 2009 at 5:12 pm

    Just found out that some people were having issues with the uploader not working due to the fact that the images folder in the plugin was not writeable. Please make sure that add-logo-to-admin/images is writeable.

  2. tp on February 27, 2009 at 3:39 am

    Is it possible to upload a logo for the login page and a different logo for the admin header? I would like to do something similar to the original wordpress where the login logo is bigger (logo + wordpress), and the admin logo is just 32*32 (logo).

  3. c.bavota on February 27, 2009 at 11:07 am

    Hey tp,

    Right now there is no way to have a different logo for the admin and a different logo for the login. I will consider adding that functionality to a future version of the plugin. Thanks.

  4. Chuck on February 27, 2009 at 4:42 pm

    I installed your plugin and it works, thanks. One problem that I discovered was that the “visit site” link no longer appeared in the header. After doing some research and debugging I discovered that you are replacing the visit site anchor with the newLogo image. I reworked the addLogo function in the admin.js file to replace the img tag rather than overwrite the a tag. Here is the code:

    function addLogo() {
    var myHead = document.getElementById(“wphead”);
    var curLogo = document.getElementById(“wphead”).getElementsByTagName(“img”)[0];

    var myLogo = document.createElement(“img”);
    var imgSrc = newLogo.site+newLogo.logo;
    myLogo.setAttribute(“src”,imgSrc);
    myLogo.setAttribute(“id”, “newLogo”);

    myHead.replaceChild(myLogo,curLogo);
    myBody.style.display = “block”;

    return false;
    }

    I also modified the wp-admin.css file to handle the new image as it needs to be floated left and removed the #wphead h1 a display none style.

    Regards,

    Chuck

    • c.bavota on March 1, 2009 at 3:13 pm

      Hey Chuck,

      I had originally coded the plugin to work with 2.7 which does not have that img tag in the header. That is why I replaced the “View Site” tag, which also made the logo the link to click back to the site. The above mod will only work in 2.7.1. with the new version of the plugin if you change var imgSrc = newLogo.site+newLogo.logo; to var imgSrc = newLogo.logo;.

      Thanks.

  5. Lori on February 27, 2009 at 10:05 pm

    Hi,
    I love the plugin, so easy. I have found a bit of a problem, when the plugin is active I get an error when updating theme files.
    Footer options would be a great addition to the plugin too.
    Thanks for all your work!!

    • c.bavota on March 1, 2009 at 3:30 pm

      Hey Lori,

      I had been encountering this issue as well and didn’t realize it was all my fault. I have gone in and fixed the problem with the plugin. Uploading it right now.

  6. Jim on February 28, 2009 at 12:58 pm

    Don’t mean to keep buggin’ ya, but I have another problem with your plugin. I have found that once your plugin is active I can no longer modify user profiles or delete users. I am sure it is your plugin because I tested it by removing it and reinstalling, activating and deactivating, and the problem only occurs when your plugin is active. If you like email me and I will demonstrate.

    • c.bavota on March 1, 2009 at 3:31 pm

      Hey Jim,

      Fixed the issue with the latest version of the plugin. Thanks.

  7. Hector on March 2, 2009 at 9:43 am

    The plugin not display the image, i’m using WordPress 2.7.1. and your version plugin 1.3.2. not work.

    Please check. Thanks for your attention.

  8. Hector on March 2, 2009 at 9:50 am

    Bavota San

    This plugin display the image in the Dashboard of WordPress but not in the Access Area.

    Thanks for your information.

    • c.bavota on March 2, 2009 at 2:29 pm

      Hey Hector,

      I would have to take a look at your admin panel or get more information from you in regards to the problem.

  9. JimEdward on March 4, 2009 at 8:56 am

    Your plugin came just at the right time. I needed to re-brand WordPress as Strattomedia, my online coaching community.
    Unfortunately it is not showing my logo. Any thoughts? My site is in a wordpress (sub) folder right now.

  10. JimEdward on March 4, 2009 at 9:03 am

    **Correction**

    Your plug-in works! User error, plus I didn’t read the above post about making the folder writable.

    Thank you for your efforts…it’s a simple fix for a much needed solution.

    -Jim

  11. Josh on March 5, 2009 at 10:01 pm

    The plug-in works great with Firefox on both the login and admin page, but does not work on the login page with IE 7 (I don’t know about other versions of IE)It does work on the admin page. I am getting the same results on several computers.

    I have tried several different image formats and sizes. I get the same results with the default image.

    WP 2.7.1
    Add Logo to Admin 1.3.2

    IE Error:
    Line:20
    Char:2
    Error: ‘newLogo’ is undefined
    Code:0
    URL:”my website”

  12. Tom on March 8, 2009 at 5:46 pm

    Same problem as Josh.
    Works great in Firefox.
    Does not work in IE7.
    Tried two separate .png files. Same results. Can’t see them in IE7, only in Firefox.
    No error messages in IE7, just no logo.
    I have WordPress 2.7.1 and Plugin version 1.3.2

  13. c.bavota on March 10, 2009 at 11:28 am

    Just updated the plugin to version 1.3.3 which addresses the issue with IE7 and the logo not appearing on the login page. It was all because of one little comma. One stupid little comma!

  14. baron on March 10, 2009 at 11:51 am

    Works great, thank you

  15. emmeellep on March 11, 2009 at 6:45 am

    my solution, before the upgrade, was borrowed from register plus.

    1. I included jQuery by:
    <script type = ‘text / javascript’ src = ‘ wp-includes/js/jquery/jquery.js? ver = 1.2.3 ‘>

    2nd I made the link of the logo with a link to the home (not wordpress)

    jQuery(document).ready( function() {
    jQuery(‘#login h1 a’).attr(‘href’, ”);
    jQuery(‘#login h1 a’).attr(‘title’, ”);
    });

    3rd I removed from the css background image and added my :)

    #login h1 a { background:none; background:transparent url() center top no-repeat; padding-bottom:24px }

    Ciao :)

  16. Tom on March 11, 2009 at 10:09 am

    Thanks, c.
    You fixed the IE7 issue. Works great! Great plug in!

  17. Maciej on March 19, 2009 at 4:21 pm

    Great plugin but I would ask for one new feature :)
    It will be very usefull to select one image for login page and different for admin page. Both pages are different (background and size) so I need small white logo on admin and big black logo on login page.
    Is it possible to upgrade that plugin?

    • c.bavota on March 20, 2009 at 8:58 am

      I’ll work on that for the next upgrade to the plugin.

  18. MarcM on April 17, 2009 at 2:41 pm

    Hi

    I sent you a modified version of this plugin a week or so ago and haven’t heard back. It allows different images as requested in comments 402 and 850 (which I needed too).

    LMK if you didn’t get the message and i will send again.

    • c.bavota on April 23, 2009 at 11:38 am

      Hey Marc,

      I did not receive it. Can you send it again?

    • MarcM on May 18, 2009 at 9:30 am

      Just sent again. Hopefully gets through this time :-)

  19. Yvonne, My Halal Kitchen on May 1, 2009 at 2:33 am

    I tried this and the image I uploaded totally overpowered the top half of the page! What happened?

    • c.bavota on May 6, 2009 at 11:30 pm

      What was the size of the image?

  20. 3dvisuarq on May 5, 2009 at 6:28 pm

    Very nice template, exactly what i was looking for.

    Only one thing i can not get. Is how put my logo banner in my post pages using this template.

  21. Amy on May 13, 2009 at 5:56 pm

    Hey there…I successfully installed, but when I upload pics, nothing happens. The only available pic is the default (your logo). Ideas? Thanks!

    • marcm on May 18, 2009 at 9:23 am

      Be sure your webserver has write permissions to add-logo-to-admin/images directory. Permissions should likely be 755

  22. Lillian on May 22, 2009 at 1:44 am

    Hi, great blog. I was wondering, how do I get my logo in the title tag to replace the default blank doc pic?

    • c.bavota on June 18, 2009 at 1:38 pm

      That is called a favicon. Convert your image to a favicon with any online favicon generator. Then upload the file to your site’s main directory.

  23. Ella on June 4, 2009 at 1:50 am

    Hi…! This rocks. You rock. Thank you for sharing and helping people out. I send you a virtual beer :)

  24. Misao on June 8, 2009 at 5:11 am

    Thx, very nice plugin.:D

  25. nijinski on June 15, 2009 at 2:22 am

    Warning: moveuploadedfile(/home/g2xx/publichtml/blogpage/wp-content/plugins/add-logo-to-admin/images/g2xx-white-trans.gif) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/g2xx/publichtml/blogpage/wp-content/plugins/add-logo-to-admin/add-logo.php on line 36

    Warning: moveuploadedfile() [function.move-uploaded-file]: Unable to move ‘/tmp/phpVzeNBq’ to ‘/home/g2xx/publichtml/blogpage/wp-content/plugins/add-logo-to-admin/images/g2xx-white-trans.gif’ in /home/g2xx/publichtml/blogpage/wp-content/plugins/add-logo-to-admin/add-logo.php on line 36

    Warning: Cannot modify header information – headers already sent by (output started at /home/g2xx/publichtml/blogpage/wp-content/plugins/add-logo-to-admin/add-logo.php:36) in /home/g2xx/publichtml/blogpage/wp-content/plugins/add-logo-to-admin/add-logo.php on line 59

    anybody got any ideas for this newbie. installing my logo produces the above errors.

    thanks in advance

    • c.bavota on June 18, 2009 at 1:37 pm

      Looks like you don’t have the right permissions set for that folder.