Entries Tagged as ''

WordPress 404 Redirect And 404 Custom Message

The WordPress 404 error page or the 404 error message is probably the file or piece of code most neglected by WordPress theme authors. This short will show you how to spruce yours up a bit.

Keeping visitors on your WordPress blog should be one of your main objectives to blogging. When they find themselves on a dead end they may just leave. Why not entice them to look around a bit, redirect them to a different page, or place some AdSense on your 404 page and at least get paid when they leave your site.

First check yours out by typing in URL on your blog that you know doesn’t exist. Most WordPress blogs show something like this:

404.jpg

Well that is really wanting me to do something like… leave! WordPress handles 404 errors differently than an HTML site and creating a 404 redirect in your .htaccess file will not work, at least that I know of. The 404 error that is displayed is theme specific and has to be edited within the themes files. So switching themes means these changes will not follow.

Next determine if you have a separate 404.php file with your theme or if it uses some code in the themes main index file (index.php). From within the WordPress dashboard click Presentation then Theme Editor. Look on the right side for the 404.php file. If you have a 404.php file you can make the changes to it. If you don’t have a separate 404.php file you can create one or make the changes you want in the index.php file.

If you have a current 404.php file and want to redirect visitors to another URL. Or to make your own 404.php file to redirect your visitors to another URL place the following code into a text file, change the URL and save it as 404.php and upload it to your current WordPress themes directory:

<?php
header(”Status: 301 Moved Permanently”);
header(”Location:http://www.ChangeToTheURL.com”);
?>

Do not copy the code from the post! Click here to open the proper text file to copy.

Now if you want to display something more interesting on your 404 error page you can edit your 404.php file or find where in your index.php file to make the changes. To determine where the code is in the index.php file open it in the Theme Editor and look for this piece of code:

<?php else : //if there were no posts available ?>

You can now edit what you want between that bit of code in your index.php file and the next line of code. You can start by changing the text between the h2 tags shown below:

<h2>Error 404 - Not Found</h2>

You can also add a few links and more text below the h2 tags and even some AdSense code if you want. I added a search box for my blog and some AdSense. Make sure you backup any file you are editing first so if you don’t like your changes or break your blog you can restore it easily.

Here is a sample of what I used to create the 404 error message on this site: You can use this in either your index.php or 404.php file: Sample 404 Error You can add more space between items with a few more breaks <br/> if you like.

Well what started out as short guide has grown bigger than I thought and there are many other items you can place in the 404 error area of your blog. Just make sure you close all the tags and make a backup before you start hacking the code!

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!


Tagged with , ,


Related Posts



Specify WordPress Navigation Page Links

If your WordPress blog has a navigation or top menu bar that shows all your WordPress pages and you create a lot of pages this can become quite cluttered. You can change this to specify the pages or links displayed from within your WordPress themes template files. This shows how to specify WordPress navigation page links.

First your themes files need to be writable in order to edit them from within the WordPress dashboard or you will need to edit the file and upload it with an FTP client. From within the WordPress dashboard click Presentation then Theme Editor. On the right side of the theme editor click Header to open the header.php file. Depending on your theme you should see some code that looks like this:

<div id="top-menu">
<ul>
<li><a <?php if (is_home()) echo('class="current" '); ?>href="<?php bloginfo('url'); ?>">Home</a></li>
<?php wp_list_pages(’depth=1&title_li=’); ?>

</ul> </div>

The piece of code that shows the pages is in red. This is showing all pages you create and doing so can cause that list to grow quite large. You can just remove that code and hard code the actual pages you want in that area.

If you are a not familiar with editing WordPress themes make sure to copy all the code in the file and save it so you can restore any mistakes you might make!

Now just remove the bit of code in read and replace it with a regular HTML formatted code like this:

<div id="top-menu">
<ul>

<li><a <?php if (is_home()) echo('class="current" ');
?>href="<?php bloginfo('url'); ?>">Home</a></li>

<a href="http://www.TheURL.com/" title="Page
Title Here">Page Title Here</a>

<a href="http://www.TheURL.com/" title="Page
Title Here">Page Title Here</a>

</ul> </div>

If you copy the above code to use it on your site and doesn’t work check for the proper format of all the quotes ” I tried to format them so they come through properly but may have missed one! To replace the curly quotes ” with regular ones just remove them and simply retype them again.

(I really need a good plugin to show raw HTML and PHP code in posts)

Now you can specify the exact page, or any URL for that matter simply by hard coding it directly into your WordPress header.php file.


Tagged with


Related Posts



WordPress Plugin Installation Guide Video

Installing a WordPress plugin is very easy once you learn the basics and the steps involved. After you install the plugin showed in this you may never need to use an FTP client to upload WordPress plugins and WordPress themes again.

The steps outlined in this video are for installing a plugin that requires its whole folder or directory to be uploaded to your hosting account. Usually uploading an entire folder is required when there are mutiple files associated with the plugin. Some plugins only require a single file to be uploaded while some may require other files to be uploaded into other directories. Always read the instructions supplied with the plugin to eliminate any issues.

The steps outlined in the video are as follows:

 

  • Download the plugin
  • Extract or unzip the compress file
  • Read the installation instructions
  • Connect to your hosting account with an FTP client
  • Upload the plugin
  • Activate the plugin from the WordPress dashboard

You can download the One Click Installer on WordPress.org here:
One Click Installer


Tagged with ,


Related Posts



WordPress Blog Optimization Check List

So you have a newly installed WordPress blog but now what? Well to get the most from it you should check a few things to make sure it is configured correctly and optimized.

Contrary to what you may have read or been told, WordPress or blogging is not going to be replaced or rendered obsolete by other content management systems any time soon. Yes some systems allow you to easily add pages to your site and make site-wide additions or tweaks within one central location as WordPress does. But when it comes to the blogging community and the viral traffic generation it brings, WordPress and blogging in general, will continue to grow and evolve.

Having a nice website that is easy to control is only part of the equation. Correctly using an optimized blog as part of your site is probably the easiest way to generate traffic to funnel into that nice site you have been working on.

Here are a few things to look for in a WordPress blogs dashboard to make sure it is properly configured and optimized.

From within the WordPress dashboard click Options, check the title of your blog. Is it correct and a unique name? Under that is the blogs Tagline, if it is this: ‘Just another WordPress weblog’ then; Your Blog Is Not Optimized.

Next click Options then Permalinks. If the default option is selected; Your Blog Is Not Optimized.

Next click Manage, Posts and then click edit next to a post to open it. Scroll down below the write post box and see if you can find the upload area that looks like this:

upload.gif

If its not there and you see an error message; Your Blog Is Not Optimized.

If you have an upload option available try to upload a small graphic file with it. If you get a failed to write to disc or any other error message; Your Blog Is Not Optimized.

Next click Options, Plugins, Check for a few important plugins like:

 

  1. All in One SEO
  2. Sitemap
  3. Subscribe to Comments
  4. Smart Update Pinger
  5. WordPress Backup
  6. WordPress Stats
  7. Some type of social bookmarking plugin.

The most important plugin is for SEO. If you don’t have any plugins installed other than Akismet and Hello, then; Your Blog Is Not Optimized.

This post is just a reality check and not a guide on how to optimize your WordPress blog. If you use some of the resources here on my site and online you will find all the information you need to optimize your WordPress blog.

You can start here: WordPress Optimization Guide

I can optimize your blog for a very reasonable fee depending on what you want done check out: WordPress Optimization Service


Tagged with


Related Posts



WordPress New Blog Options Checklist

After installing WordPress there are a few options that should be addressed for optimal performance. This is a short general for those new to WordPress blogging. If you haven’t configured the general options yet then start by reading this post: WordPress General Options Guide

After configuring the general options, next click the Users panel and the users assigned to the WordPress blog will be displayed. Click edit on the far right next to your account to open it. Add and update the information in this area. You can also change your password here if you wish. At the very top of this panel is an option to “Use the visual editor when writing”. Checking this option will allow you to use a slimmed down version of a WYSIWYG write post editor. Unchecking it will show only a “code” editor when writing posts, with limited options for those not familiar with HTML code.

Click the main Options panel again and then the Writing subpanel. In the writing subpanel you can specify the size of the write post box and the default post, and link category. You can also setup an email account to post to your blog by email. The last option in the writing subpanel is Update Services. This is a list of blog services to notify when your a new post is made. I suggest and install the Smart Update Pinger plugin for this purpose. You can add some or all of the following list into this area or in the options for Smart Update Pinger:

http://blogsearch.google.com/ping/RPC2
http://rpc.pingomatic.com/
http://rpc.technorati.com/rpc/ping
http://www.technorati.com/
http://ping.feedburner.com
http://api.my.yahoo.com/rss/ping
http://api.feedster.com/ping
http://api.moreover.com/ping
http://api.moreover.com/RPC2
http://blog.goo.ne.jp/XMLRPC
http://blogdb.jp/xmlrpc/
http://coreblog.org/ping/
http://ping.blo.gs/
http://ping.bloggers.jp/rpc/
http://ping.syndic8.com/xmlrpc.php
http://ping.weblogalot.com/rpc.php
http://pinger.blogflux.com/rpc
http://rpc.blogrolling.com/pinger/
http://rpc.icerocket.com:10080/
http://rpc.weblogs.com/RPC2
http://topicexchange.com/RPC2
http://www.blogdigger.com/RPC2
http://xping.pubsub.com/ping
http://api.my.yahoo.com/rss/ping
http://1470.net/api/ping
http://www.a2b.cc/setloc/bp.a2b
http://api.my.yahoo.com/RPC2
http://www.bitacoles.net/ping.php
http://bitacoras.net/ping
http://blogbot.dk/io/xml-rpc.php
http://blogmatcher.com/u.php
http://www.blogoole.com/ping/
http://www.blogoon.net/ping/
http://www.blogpeople.net/servlet/weblogUpdates
http://www.blogroots.com/tb_populi.blog?id=1
http://www.blogshares.com/rpc.php
http://www.blogsnow.com/ping
http://www.blogstreet.com/xrbin/xmlrpc.cgi
http://bulkfeeds.net/rpc
http://ping.bitacoras.com
http://ping.myblog.jp

The next Options subpanel to click is the Reading subpanel. Clicking it will give you the option to use a static front page for your blog. This will show a page that you create instead of the regular blog loop. To learn how to properly use the static front page option check out this post: How To Use A Static Front Page With WordPress.

You can also specify how may posts to show on the main blog page, and if pulling content from a syndicated feed whether or not to show them as a full post or just a summary.

Next is the Discussion subpanel; here you can specify how to handle comments and incoming links (trackbacks). I suggest all options but two be checked in here. The only two to uncheck under Before a comment appears: should be An administrator must always approve the comment and Comment author must have a previously approved comment. This will allow for people to comment easier. The remainder of this area is to blacklist nasty blog comment spammers. I suggest holding a comment if it has more than 2 links in it. And you can also blacklist certain spammers in this area if you wish but I have found either the Akismet or Spam Karma plugins to effectively stop most comment spam.

The Privacy subpanel only has two choices in it; either to let your blog be visible to everyone, including search engines (like Google, Sphere, Technorati) and archivers, or to hide it from them. I highly suggest you allow it to be visible unless you want to share your blog with only people you give the URL to.

The last options subpanel is Permalinks. This option will change the actual URL of your blog posts to one specified by you in this area. For more about permalinks I have a guide posted here: WordPress Custom Permalink Structure

I hope you found this post useful and be sure to use the search function on the sidebar or read the WordPress Optimization Guide for more.


Tagged with


Related Posts



WordPress General Options Guide

One of the first things that should be done for a new WordPress blog is to configure the general options. The WordPress general options panel consists of the following options:

 

  • Blog Title - The name of your blog
  • Tagline - A brief description of your blog
  • WordPress Address - The location of the WordPress core files
  • Blog Address - The URL location of the blog
  • E-mail Address -A valid e-mail address that you control
  • Membership - Use this to determine if and how news users are handled
  • New User default Role - Determines the capabilities of new users
  • Date And Time - Sets the time and formats how its displayed

The blog name should be self explanatory so if you need help with this one… The Tagline should be a brief description of your blogs content with at least a main keyword in it. You can change these at any time but I suggest once you start blogging on a regular basis and submit your blog to various directories and the search engines come around and crawl your blog you should leave them alone.

The WordPress address is where the core files of the blog are stored, you can have them stored in a different directory on your domain other than where the blog is installed if you wish. I suggest just keeping this and the Blog Address, the URL of the main blogs page, the same but if you want to move things around here is a guide to help: Giving WordPress its Own Directory

If your WordPress address and Blog address doesn’t have the www in front of it in you can add it to both of their boxes. Both of these boxes should match (unless you specified the change from the guide linked to above) or issues will arise in the dashboard when browsing for old posts.

The E-mail address is used for the blog to communicate to you and for various options such as new comments or new users added to the blog. It will also be used with some plugins to send email to people who might comment on your blog. To make your blog interactive as possible this should be an email account that you check frequently.

The Membership option is checked only if you want anyone in cyberspace to be able to register an account on your blog. The account level they are registered as is determined by the New User Default Role, be careful here. If only you are using the blog then do not check the Anyone can register box. If you want people to register on your blog you should determine the level of capabilities you want to give them here: Roles And Capabilities

I highly suggest unchecking the Users must be registered and logged in to comment box to encourage comments, interactivity and repeat traffic to your new .

The Date and Time area is used to set your local the time relative to current UTC (Controlled Universal Time). The current UTC time is shown at the top of this area like this: UTC time is: 2008-02-07 4:20:16 pm
Simply figure the difference between the current UTC time shown and your local time and place the difference in the box next to “Times in the blog should differ by:“.

Finally the Default date format and Default time format are how the time and date are shown on various areas of the blog. For different options to change the format I will refer you to this: Customizing the Time and Date


Tagged with , ,


Related Posts



Adding and Changing WordPress Themes

One of the first things a new WordPress blogger wants to do is make their new WordPress blog look the way the want it to. Adding a cool new WordPress theme and then maybe even customizing it a bit. But before you add a new theme and start looking for someone to “pimp your blog” I suggest you try several different themes see how the work and look for a while. Once you are sure you like the theme then get that custom header made and installed, and learn how to tweak it over time.

Here is a short to help you find and install new new using the OneClick Plugin.

From the WordPress dashboard click Presentation on the main panel. Here you will see the current theme first and other installed themes below it. Simply scroll down and click on the theme you want to use and it will now be active. Now that was simply wasn’t it?

If you don’t like any of the installed themes and want another just go to themes.wordpress.net for thousands of free themes to download. Or perform a simple Google search for WordPress themes. After you download a theme to your computer do not unzip it. If the “OneClick Installer” plugin is activated you should see the OneClick Install subpanel under the main dashboard. Click OneClick Install, browse to your new theme next to “Browse”, choose Theme on the drop down box and upload it. Go back to the Themes subpanel and activate the theme it if it isn’t already activated.

I highly suggest choosing a theme that is “Widget ready”. You can sort themes at http://themes.WordPress.net/ for only “Widget ready” themes but at times a few that aren’t will get through. The only real way to see if a theme is “Widget ready” is to activate the theme and look for a Widgets subpanel next to the Themes subpanel.

While we are talking about themes and are in the Presentation panel you should also see the following subpanels or more depending on the currently activated plugins.

Themes Widgets Theme Editor

The Theme Editor shows the code for the current theme; on the right side are the different templates related to current theme. You can make changes to the themes templates here if you know how but that is beyond the realm of this tutorial. Just keep in mind if you plan on messing around in here be sure to copy the contents of the file to a safe location BEFORE you do anything. If you do make a mistake paste the unedited code you saved back into the editor. If you can’t change it back you will need to delete the file you changed and upload an unedited version to your web host again. The other subpanel items in here are self-explanatory. In the future I may explain how to change the header image and make other minor changes, or if you want search Google or go to www.WordPress.org for more information.


Tagged with , , ,


Related Posts



Close
E-mail It