Remove theme my login extra css file and add it’s code to wordpress theme

By removing the additional css files and combining their code in one we can save the load time of the site.

There are wordpress plugins available to do that too, but if you want to do it manually, this tutorial will guide you through it.

The code added by the theme my login plugin to the css file is very small, just a few lines, so its wise to add this to our already existing css file to reduce the load time of site by reducing the number of files being downloaded.

I know many people will argue that this is not needed, as small things don’t matter much, but in my opinion, small things matter the most . . . so here we go !

To remove the additional css file added by theme my login plugin and add the code to the wordpress theme’s own css file, follow these steps:

1. Copy the theme my login css file content to theme file

First step is to move the content of the theme my login css file to them theme’s css file.

To do this, open your blog in the browser, view source and click on the theme my login css file in it, it will show the css code inside it. Copy that code and add it at the bottom of your theme’s css file.

Or you can also copy paste this code at the end of your theme file:

/* theme my login start */
.login {padding: 5px;}
.login p.error {padding: 5px;border: 1px solid #c00;background-color: #ffebe8;color: #333;}
.login p.message {padding: 5px;border: 1px solid #e6db55;background-color: #ffffe0;color: #333;}
.login form label {display: block;}
.login form p.forgetmenot label {display: inline;}
/* theme my login end */

2. Remove the css file added by the plugin

Next step is to remove the css file added by the theme my login plugin to the wordpress blog.

This can be done in two ways.

One is to goto: settings > theme my login

And in the option uncheck Enable “theme-my-login.css”

For some plugins, which don’t provide this option, you can have an idea by doing it in theme my login as follows:

To do this:

  1. goto: <wp dashboard left menu>/plugins/Editor
  2. from the drop down to the right, chose Theme My Login plugin
  3. from the list of files that are shown for theme my login plugin, chose: theme-my-login/includes/class-theme-my-login.php
  4. in that file, find this code on line 136:
    wp_enqueue_style( 'theme-my-login', $this->get_stylesheet(), false, $this->get_option( 'version' ) );

    and comment it by adding // before it like this:

    // wp_enqueue_style( 'theme-my-login', $this->get_stylesheet(), false, $this->get_option( 'version' ) );

Leave a Reply

Your email address will not be published.