Feb
25
2009

Add Logo to Admin WordPress Plugin


I have revamped my first plugin to make it a little easier to use. If you have tried it before and weren’t impressed give it another shot. I have included an admin uploader so you can easily upload your own logo and choose whether you want it to appear on the Admin page and/or the Login page. You can also upload multiple logos and then select the one you wish to use for now.

Any feedback or suggestions would be totally appreciated.

addlogo

This plugin is build for WordPress 2.7.x. It doesn’t really work for earlier versions.

If you liked this, please share it.
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 91 Comments

  1. Stevieb on December 16, 2008 at 8:49 pm

    And where are the settings in the admin panel to make all this cool stuff happen? ;)

    • c.bavota on December 16, 2008 at 8:55 pm

      There is actually nothing you need to do to make it work other than activate it. Just upload your logo to the images folder of the plugin and call it logo.png and it will all work automatically.

  2. tom on December 16, 2008 at 9:06 pm

    Uploaded and activated. Doesn’t seem to do anything.

    • c.bavota on December 16, 2008 at 9:11 pm

      Hey tom,

      Which version of WordPress are you using?

  3. Glen on December 16, 2008 at 10:34 pm

    Hello,

    I am running wp 2.7 and got his error “Fatal error: Cannot redeclare add_logo_to_admin() (previously declared in /home/content/g/l/e/mydirectory/html/attraction/wp-content/plugins/add-logo-to-admin/trunk/add-logo.php:12) in /home/content/g/l/e/gmydirectory/html/attraction/wp-content/plugins/add-logo-to-admin/add-logo.php on line 11″ when I tried to activate this plugin.

    Thanks,

    Glen

  4. BobG on December 16, 2008 at 10:41 pm

    Greetings. I am experiencing the same problem.

    I am using a new install of 2.7. I used the plugin install feature in the admin dashboard to install. I uploaded logo.png (74×70, 54,850 bytes) to /public_html/wp-content/plugins/add-logo-to-admin/trunk/images/ , replacing the logo.png file that was there.

  5. c.bavota on December 16, 2008 at 10:54 pm

    Hey Glen and BobG,

    This is my first plugin and I obviously messed up with the install to WordPress. I have just updated it to version 1.0.2 to fix all these issues.

  6. tom on December 17, 2008 at 5:34 pm

    Chris,

    Sorry for the snarkiness (is that a word?) of the comment I left. I was just short of time and hit ‘submit’ before I looked back at it. I’m running 2.7 and it seems that your recent update fixed the problem. Thanks. It’s little touches like this that make a blog feel personal and it’s programmers like you that make it all possible. Thanks again.

  7. c.bavota on December 17, 2008 at 5:38 pm

    Hey Tom,

    No worries. Thanks for letting me know that it wasn’t working properly.

  8. tom on December 17, 2008 at 1:26 pm

    Is there a proportion limit on the graphic? I used one that was taller and not as wide (proportionally) as yours and it stretched it. I made one the same dimensions as yours and it worked fine.

  9. tom on December 17, 2008 at 2:08 pm

    Scratch that – it was a cache thing. The new graphic was displayed but with the old graphic’s proportions. After I cleared the cache, it worked fine.

  10. brtak on December 18, 2008 at 4:26 am

    Sorry for that, but i see my logo only on wp-login page not in admin? I run WP 2.7. On the web test.mysite.com works good but on mysite.com i see logo only on wp-login.php. All browsers same. Cache cleared. Any idea, pls?

  11. brtak on December 18, 2008 at 5:12 am

    Nevermind, its working now, i switch all plugins off, and looks like that Audio player 1.2.3 when active, this not work at admin page, any idea to fix it?

  12. brtak on December 18, 2008 at 5:18 am

    Nevermind again, fixed with new beta of Audio player 2.0b6. Works good, thx!!!

  13. eKLiPse on December 18, 2008 at 6:56 am

    I’ve tested your plugin, and i’ve found a ‘bug’ and it’s solution. When WordPress it’s not installed on the root of the server, the icon doesn’t shows on login screen, but works fine on admin pages.
    To solve it all you need to do is change the value of the imgSrc variable on login.js and remove the “../” from the value, otherwise it will make reference to a non existent image.

    • c.bavota on December 18, 2008 at 11:12 am

      Hey eKLIPse,

      Thanks for the solution to that issue.

  14. Johan Vanstraelen on December 24, 2008 at 5:54 am

    I see in your login.js that you do the following thing:
    window.onload = addLogo

    This is a very dangerous thing to do, because, in this way, you overwrite all previous actions that already should be done at the onload. It is better to do something like the following:

    var onloadOrig=window.onload;
    if (typeof window.onload != 'function') {
    window.onload = function() {
    addLogo();
    };
    } else {
    window.onload = function() {
    onloadOrig();
    addLogo();
    };
    }

    This way, you keep the original functions in the window.onload intact.

    • c.bavota on December 24, 2008 at 3:37 pm

      Hey Johan,

      Thanks for the tip. I have gone in and updated the plugin using a slightly different version of the code you suggested. I also upgraded the plugin a bit by adding an option page in the admin. Take a look for version 1.1 on the WordPress site.

  15. ravi on January 28, 2009 at 9:43 am

    Excellent one. Really worked perfectly.

  16. Serafino on February 5, 2009 at 10:25 am

    Never nice. Got it working with a couple of issues.

    How can I center the image?

  17. JimEdward on February 23, 2009 at 3:02 pm

    Not working. Does wordpress have to be in the root folder or can it be in a separate wordpress folder?

  18. JimEdward on February 23, 2009 at 3:05 pm

    Using 2.7.1. Is it Compatible?

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

      Hey Jim,

      You are correct. It wasn’t working when installed in a subfolder. I have just updated the plugin and now everything should be fine.

  19. Shuki Haiminis on February 24, 2009 at 2:34 pm

    I am getting a red x in a blank screen on both the admin pannel and when logged in. Any suggestions as to why this is happening. Is it possible that the image is too big?

  20. mediacom87 on February 26, 2009 at 6:16 am

    Hi,

    I used older version of your plugin with success, but, i can’t use this new version with my WordPress 2.7.1.

    It’s very strange because my logo appeared on your plugin setting page but never on my admin panel or login panel ???

  21. rfolk on February 26, 2009 at 11:30 am

    Updraded to new 1.3 plugin and doesn’t work. WP 2.7.1. It appears upload is not working…

    • c.bavota on February 26, 2009 at 11:38 am

      Hey rfolk,

      Please make sure that the file you are trying to upload does not have any spaces in it’s name. So if you have “my logo.jpg” it needs to be “my-logo.jpg”.

  22. rfolk on February 26, 2009 at 11:51 am

    No spaces. Just logo.png. Then tried logo_admin.png. Same problem.

  23. rfolk on February 26, 2009 at 11:52 am

    Where is it trying to write top. Could it be write permissions?

  24. mediacom87 on February 26, 2009 at 12:19 pm

    All it’s ok after your mail.

    Thanks a lot if you change something.

  25. Jim on February 26, 2009 at 1:41 pm

    I am using 2.7.1 and version 1.3.1 of your plugin and it doesn’t seem to work. I choose the file to upload (a jpg with no spaces in the file name), I click “save changes” and the image is blank. The select and delete choices are there but no image although a placeholder for the image does appear. When I refresh the page only the original image you provide with the plugin appears. Any help would be appreciated. Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *

*


To enter code in the comment box, please place it between <pre lang="php"> </pre> tags. You don't have to convert any characters to their hex/HTML code. Just add your code the way you would to any code editor.