home iconemail icon

Spokane Web Design - Web Hosting - Search Engine Optimization (SEO)

web design logotop edge

Archive for the ‘WordPress Tidbits’ Category

I decided to redo the favicon for 20 Miles North Web Design and I figured it would be worthwhile to show the simple steps to add one to your WordPress websites. There are some pay tools that create favicons a little cleaner but I used a free tool that everyone could get a handle on with ease for this demonstration. You can begin with a blank canvas or an image, I started with this image:

favicon imageThis image is 75px X 75px and it will give you a good idea about how glows and shadows translate into a pixel perfect fashion. Once you have created an image, go to http://www.favicon.cc

Click ‘Create New Favicon’ and then ‘Import Image’

It will ask you about the dimensions and you have to make a judgment about which way you want your image shrunk, the good thing is you can always just start over if you choose one that is distorts your favicon.

You will see a blown up image of your favicon in the top window.  Below that, you will see a preview window that will show the actual size your favicon will be displayed.  This is how it will show up in the top window of website browsers  and in the favorites folder if someone bookmarks your website.  From the larger pixelated window, you can make spot color edits that can make your image clearer in the smaller form. You can also animate your favicon which will typically not work in Internet Explorer but has a decent level of support in other browsers.

After you have your image set up like you want to,  just download it to your computer.  Upload it to your server anywhere you want, just take note of the path, you will need that in the next step.

Go to your WordPress administration page, on the left site click on ‘Appearance’ then select ‘Editor’ from the drop down.On the right hand side you will see a list of files, select the one called ‘header.php’.  In the editor, add  the following line of code  after the <head> tag and before the </head> tag (I have used my image path, please use your own – I think this goes without saying but just in case):

<link rel=”SHORTCUT ICON” href=”http://www.20milesnorth.com/images/favicon.ico”>

Now if you see this message at the bottom of the screen: You need to make this file writable before you can save your changes.

That just means you will have to either make the file writable or do it manually with any text or web editor.

To do this just get into your blog folder,  (most will have it in public_html or www) then wp-content–>themes–>YOUR THEME NAME–> header.php

Right click to change the permissions to writable ( I highly recommend you put it back to default permission settings after you add the code)

If you have website pages outside of the WordPress framework, simply add the same code to each page header.

I know many think it is silly to spend time on small things like this but I think it is the small personal touches that makes your website your own and it only takes a few minutes.

wordpress If you have ever enabled the meta widget in your WordPress sidebar you always come up with a few links. Usually you will get a log in link, 2 rss links and a WordPress.org link. Normally this is not an issue but if you would like to remove any or all of these, it is very simple. This is how you do it.

1. In your wp-includes folder, you will need to edit the default-widgets.php file.

2. Open default-widgets.php in your favorite web editor. The standard meta data starts at line 273. You will see an unordered list around line 295, this is where you want to do most of your editing.

3. Remove any link you want, just be sure to remove the list tags around each so you do not have any gaps.

That’s it!

More website design tutorials

WordPress Login Screen

The WordPress standard log-in screen is pretty dull to say the least. There is a simple way to create a plug-in that customizes the log-in screen. [This has been tested for WordPress 3.0.1] .

The first question I guess is “why use a plug-in instead of hacking into the plain source code?” The solution is simple, if you make changes to your source code in the wp-admin folder you will not only probably have to redo it when updates are made to the WordPress framework, you will have to redo all your work. Doing it via plug-in keeps it all separate and neat, you can also carry the plug-in to multiple blog sites for repeat use with no hassles.  I have included the entire plug-in at the end of this tutorial if you are having trouble or just plain lazy :)

Lets get started (be sure that you do this in a real web editor, notepad will mess up the formatting).

Step #1 Create a new folder for your plug-in

If you are not sure where your plug-ins are located, just open a FTP client, go into your blog root folder –> wp-content –> plugins (you will likely see Akismet folder that comes with WordPress).  Create a new folder named loginscreen and upload it here.

Step #2 The actual plug-in

Inside your ‘loginscreen’ folder, create a text document and rename it custom-wp-login-page.php the code below is to be inserted into the new php file custom-wp-login-page.php.

Start with your code:
A. Author information
/*
Plugin Name: Custom WordPress Log-in Page
Plugin URI: http://www.20MilesNorth.com
Description: Customize your WordPress Log-in Page, find more at 20 Miles North Website Design & Hosting
Version: 1.0
Author: Rob Jenkins
Author URI: http://www.20MilesNorth.com
*/

This code is what will come up inside your WordPress administration panel when you look in your plug-ins tab to the left. It will be clear to you once you have everything uploaded.

B. Functions

function custom_wp_login_page () {
$url = get_settings(‘siteurl’);
$url = $url . ‘/wp-content/plugins/loginscreen/login-page.css’;
echo ‘ ‘;
}

This section of code will call up a new stylesheet that will restyle the admin log-in page. We will be building and explaining this stylesheet further down below.

function addContent($content = ”) {
$content .= ”

GET IN HERE!

“;
return $content;
}

This section of code adds a line of text for you to edit that appears right above the log-in box

function addHeader($htext = ”) {
$htext .= ” Developed by 20 Miles North Web Design”;
return $htext;
}

This fuction adds text to the title tag of the customized WordPress logo.  Be sure to leave that space as the first character.

C.  Actions and filters
//Actions
add_action (‘login_head’, ‘custom_wp_login_page’);
//Filters
add_filter(‘login_message’, ‘addContent’);
add_filter(‘login_headertitle’, ‘addHeader’);
?>

This section of code hooks your actions and filters into the main login.php file and tells it where to put each of your functions.

Here is the entire code that should go into the custom_wp_login_page.php

/*
Plugin Name: Custom WordPress Log-in Page
Plugin URI: http://www.20MilesNorth.com
Description: Customize your WordPress Log-in Page, find more at 20 Miles North Website Design & Hosting
Version: 1.0
Author: Rob Jenkins
Author URI: http://www.20MilesNorth.com
*/

function custom_wp_login_page () {
$url = get_settings(‘siteurl’);
$url = $url . ‘/wp-content/plugins/loginscreen/login-page.css’;
echo ‘ ‘;
}
function addContent($content = ”) {
$content .= ”

GET IN HERE!

“;
return $content;
}
function addHeader($htext = ”) {
$htext .= ” Developed by 20 Miles North Web Design”;
return $htext;
}

//Actions
add_action (‘login_head’, ‘custom_wp_login_page’);
//Filters
add_filter(‘login_message’, ‘addContent’);
add_filter(‘login_headertitle’, ‘addHeader’);
?>
3. Getting your CSS file

The best way to do this is to start with a framework that WordPress already provides.  What I did was go to wp-admin –> css –>login.css and copy that file, rename it login-page.css, and save to the loginscreen folder. As you dissect what is here in the CSS and tinker around with it, make sure after every item you change you put !important before the closing ;.  This makes sure it overrides any other CSS information that may be defaulted elsewhere. You can see the ids and classes I have changed in the sample CSS below.

4. Activate your plug-in

Make sure all your files are uploaded into the right folders, then log-in to your WP admin and select plug-ins from the left menu and activate your new plug-in.  It will not work until you do so.

As you can see in my sample I have customized almost every field, just look for the !important tags in the sample CSS to see where I made edits.  Try a few things on your own and see what you can come up with, I welcome a url in the comments field for show and tell.

REMINDER: The base logo for the WordPress log-in page  is in wp-admin –>images–>logo-login.gif

The source files: loginscreen.zip

bottom edge