To my normal readers… sorry, but this post is not for you.
I’ve been asked technical questions by several people about WordPress, the software I use to publish OneMansBlog.com. So, I’ll be adding in posts occasionally pertaining specifically to WordPress hacks, tips and (hopefully) generally useful information for Blog publishers.
This first tip involves customizing the login screen that your users see when they log into your blog. Normally when users choose the login or register link a page is displayed with a giant WordPress logo which my users find to be extremely confusing. The average reader doesn’t know what WordPress is, so it would be far more appropriate for that link to go to your site. I consider this the biggest oversight in the WordPress package.
This hack will require editing three files:
- /wp-login.php
- /wp-register.php
- /wp-admin/wp-admin.css
Step 1: Download copies of these three files to your desktop, or your preferred location.
Step 2: Using Notepad, or your preferred editor, open the wp-login.php file.
Step 3: Do a search for the following text:
<h1><a href="http://wordpress.org/">WordPress</a></h1>
There will be two instances within the file and both will need to be changed.
Step 4: Replace the Heading and Hyperlink with the name of your blog and a link to your home page. For example, I used:
<h1><a href="http://onemansblog.com/">One Man's Blog</a></h1>
Step 5: Save and upload the file.
Step 6: Using Notepad, or your preferred editor, open the wp-register.php file.
Step 7: Repeat steps 3-5.
Step 8: Using Notepad, or your preferred editor, open the wp-admin.css file.
Step 9: Do a search for the following text, and delete it:
#login h1 {
background: url(images/wordpress-logo.png) no-repeat top left;
margin-top: 0;
}
#login h1 a {
display: block;
text-indent: -1000px;
height: 66px;
border-bottom: none;
}
Step 10: Save and upload the file.
The whole process should take you about 10 minutes, but it will benefit your users from now on.
One thing to keep in mind… unlike your custom theme, when you upgrade to a newer version of WordPress it will over-rite these changes and you will need to perform these steps again. For that reason you might want to bookmark this page if you think you might need the instructions again.
If you have any questions about this, or other WordPress features you find on my blog, feel free to leave a comment and I’ll see what I can do to help.






Hi,
Nice 10 steps.
What if I want to use the template in page.php, and inside that template page (page.php) i want to present your already customized login page.
I thought it will be much better :)
Cheers
Nice help. I pretty much do the same thing. But instead of actually deleting the lines, another idea for people to do is to just download the images and edit/replace them with their own personal images. As long as they remember to keep the same dimensions. This will look even better…
Peace people
We love you
This will only work in versions prior to WordPress 2.1.
Thanks for the heads up. I’ll try to take a look at 2.1 and post updated info when I get a chance.
John
Does anyone know how I can add fields to the ‘Register’ page? I want people to give their full details – their phone number, address and birth date when signing up to post/comment on my website. How can i do that?
I’m also interested in adding fields to the Register page…?
Any help available?
I’m working on modifying a Register page, and I’ve been able to make changes via the following plugin:
http://www.dealsway.net/2007/11/05/wp-user-manager/
It’s not as flexible as I would like, so I’m still searching. Good luck!
I wish I had seen this article before. I did all that is mentioned in this wonderful article. Thanks a lot for devoting time to write this article. Now I’m trying to find out ‘how to change the redirect which goes to Admin console’. Here is what I’m trying to do. If the admin logs in to the console, it should redirect to wp-admin, but if a subscriber logs in, there is no use of sending them to the wp-admin page since editing their profiles wont do any good. Their profiles are not accessible to other users (I have setup the blog that way). How to redirect them back to the blog? Thats an important question and trying to find an answer to this.
Another thing that I’m trying to do is to have the login/register form in the Header section which should be visible on all front-end pages.
This is what I’m trying to do:
On the top right of front-end pages, the visitors see Login/Register form. They click on register, they see the wp-login page. They fill out their credentials (username and email). Then they are redirected to the main page of website. They receive their password in email, they visit the website and use their username and password right up the top to login and do whatever they are allowed to do.
I guess, this simple thing will need a lot of customization in the files wp-login.php (this is where they are redirected to wp-admin page after logging in).
If I’m unsuccessful in doing all that mentioned above, this is what I will do:
If a user logs in and see the wp-admin which is Dashboard, I would like to remove all that information a subscriber see on right side. Left side is fine with Profile and Tools. On right side, they should not be able to see How many posts are there, how many comments, recent comments, incoming links to the blog, etc. Remove that and instead make it look like a regular page. I guess, this can be achieved two ways. Editing the dashboard.php file and removing those things that a subscriber see. But if I // (remove) those 3 elements, that happens even for the admin. Yeah, I know, its nuts. Anyway, what I’m thinking of doing is, make another page template and then put all information in it and make a call in dashboard.php to that file. I guess, it is going to be viewable for both – admin and subscribers.
Phew … what a mind job, but it is fun.
Is there anything that you can suggest on all this I mentioned? I would appreciate if you can suggest anything that can help directing my mixed-up thoughts.
Regards,
Andy.
OMG! I can’t believe that I am already done!!
I have setup and changed the wordpress dashboard according to my needs. It seemed like everything was there in the dashboard.php
So, if anyone is still trying to find out how to allow subscribers to view ONLY what the admin wishes to, I have the perfect answer.
I can’t write everything in one go, but here is some initial help. If OneMansBlog allows me, I can probably write a good article to help others setup Dashboard and display only that information what they want to. This code can be used to display WHATEVER you wish.
function wp_dashboard_setup() {
global $wp_registered_widgets, $wp_registered_widget_controls, $wp_dashboard_control_callbacks;
$wp_dashboard_control_callbacks = array();
$update = false;
$widget_options = get_option( 'dashboard_widget_options' );
if ( !$widget_options || !is_array($widget_options) )
$widget_options = array();
// Create the function to output the contents of our Dashboard Widget
function ksuser_dashboard_widget_function() {
// Display whatever it is you want to show
echo "Welcome to Kiss-Slap.com! A little know-how about your account. On left side, you can update your profile, add your name, change your password and update your Emial ID. Once done, you can save your profile settings.Upload Your Photo Now!";
}
// Create the function use in the action hook
function ksuser_add_dashboard_widgets() {
wp_add_dashboard_widget('ksuser_dashboard_widget', 'Your Account', 'ksuser_dashboard_widget_function');
}
// Hoook into the 'wp_dashboard_setup' action to register our other functions
add_action('wp_dashboard_setup', 'ksuser_add_dashboard_widgets' );
/* Register Widgets and Controls */
// Right Now
// wp_add_dashboard_widget( 'dashboard_right_now', __( 'Right Now' ), 'wp_dashboard_right_now' );
// Recent Comments Widget
// $recent_comments_title = __( 'Recent Comments' );
// wp_add_dashboard_widget( 'dashboard_recent_comments', $recent_comments_title, 'wp_dashboard_recent_comments' );
// Incoming Links Widget
/* if ( !isset( $widget_options['dashboard_incoming_links'] ) || !isset( $widget_options['dashboard_incoming_links']['home'] ) || $widget_options['dashboard_incoming_links']['home'] != get_option('home') ) {
$update = true;
$widget_options['dashboard_incoming_links'] = array(
'home' => get_option('home'),
'link' => apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?hl=en&scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
'url' => apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?hl=en&scoring=d&ie=utf-8&num=10&output=rss&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
'items' => isset($widget_options['dashboard_incoming_links']['items']) ? $widget_options['dashboard_incoming_links']['items'] : 10,
'show_date' => isset($widget_options['dashboard_incoming_links']['show_date']) ? $widget_options['dashboard_incoming_links']['show_date'] : false
);
}
wp_add_dashboard_widget( 'dashboard_incoming_links', __( 'Incoming Links' ), 'wp_dashboard_incoming_links', 'wp_dashboard_incoming_links_control' ); */
// WP Plugins Widget
if ( current_user_can( 'activate_plugins' ) )
wp_add_dashboard_widget( 'dashboard_plugins', __( 'Plugins' ), 'wp_dashboard_plugins' );
// QuickPress Widget
if ( current_user_can('edit_posts') )
wp_add_dashboard_widget( 'dashboard_quick_press', __( 'QuickPress' ), 'wp_dashboard_quick_press' );
I have displayed a few extra lines of coding so that you can find out where is what. This is the page at wordpress that you should read to customize dashboard fully:
http://codex.wordpress.org/Dashboard_Widgets_API
This is the original code that I inserted in dashboard.php file:
// Create the function to output the contents of our Dashboard Widget
function example_dashboard_widget_function() {
// Display whatever it is you want to show
echo "Hello World, I'm a great Dashboard Widget";
}
// Create the function use in the action hook
function example_add_dashboard_widgets() {
wp_add_dashboard_widget('example_dashboard_widget', 'Example Dashboard Widget', 'example_dashboard_widget_function');
}
// Hoook into the 'wp_dashboard_setup' action to register our other functions
add_action('wp_dashboard_setup', 'example_add_dashboard_widgets' );
All I did was change the ‘example’ to ‘ksuser’.
To see how it looks, you can visit my site and then create an account. When you login, you will see only that stuff that I allowed you to see.
This code is yet not completely customized, I will have to invest more time. One drawback of removing other parts is that, even admin doesn’t see those widgets. Hmmm.. anyone can help further customizing it?
Regards,
Andy.