Ben Eberle
Web Design &
Development

Customizing the WordPress Backend

WordPress


Share this post

A custom login page is a really nice touch. There are plugins out there that can do this, but why bother when all you need to do is to drop this into¬†your theme’s functions.php file. It will override the default WordPress login css styles and allow you to customize the logo and background. Totally fresh.


<?php

// Customize login styles

function bme_custom_login_styles(){
	?> 
	<style type="text/css">
		/* Change login page background - make sure image path is valid */
		body.login{ 
			padding-top:75px; 
		   background: #68686B url("<?php echo get_stylesheet_directory_uri(); ?>/images/login-background.jpg") 50% -250px no-repeat fixed !important; 
		}

		/* Custom logo - make sure image path is valid */
		body.login h1 a { 
			background: url("<?php echo get_stylesheet_directory_uri(); ?>/images/logo-login.png") no-repeat top center; 
			height:100px; 
			background-size: 106px 106px;
		}
		#login { padding: 10px;}
		/* Change link color & shadow if needed */
		#loginform {
			border: none; 
			-webkit-box-shadow: none; 
			box-shadow: none;
		}
		.login #nav a, .login #backtoblog a { 
			color: #999!important; 
			text-decoration:none; 
			text-shadow:none; 
		}
		.login #nav a:hover, 
		.login #backtoblog a:hover {
			color: #fff!important; 
			text-decoration:none; 
			text-shadow:#000 1px 1px 0; 
		}

		/* Add shadow to message and login boxes */
		.login form, p.message {
			-moz-box-shadow: rgba(0,0,0,0.5) 0 2px 8px;
			-webkit-box-shadow: rgba(0,0,0,0.5) 0 2px 8px;
			box-shadow: rgba(0,0,0,0.5) 0 2px 8px;
		}
	</style>
<?php
}

add_action('login_head', 'bme_custom_login_styles');
?>

Read more

Disable WordPress Post Revisions

WordPress


Share this post

Add the following lines to your wp-config.php


// Turn off revisions and set autosave interval
define( 'AUTOSAVE_INTERVAL', 600 ); // 60= 1 HOUR.
define ('WP_POST_REVISIONS', 0); // TURN OFF POST REVISIONS.

Read more

Moving WordPress Sites Server To Server

WordPress


Share this post
UPDATE `wp_posts` SET `post_content` = REPLACE(post_content, 'http://localdomain.dev', 'http://livedomain.com');
UPDATE `wp_posts` SET `post_excerpt` = REPLACE(post_excerpt, 'http://localdomain.dev', 'http://livedomain.com');
UPDATE `wp_posts` SET `guid` = REPLACE(guid, 'http://localdomain.dev','http://livedomain.com');
UPDATE `wp_options` SET `option_value` = REPLACE(option_value, 'http://localdomain.dev', 'http://livedomain.com');
UPDATE `wp_postmeta` SET `meta_value` = REPLACE(meta_value, 'http://localdomain.dev', 'http://livedomain.com');

Read more