WordPress

Resources relating to WordPress

Remove Page Titles from and Artisteer generated theme

From the post.php file, within the templates directory of your theme directory…
Remove the following code:


<?php echo $post_title; ?>
<?php echo $post_metadataheader; ?>

Note: If you are using Artisteer 3.0 or above, then the option to remove the page title is added to the page editing console (bottom right hand corner), with some other very handy page attributes.

.

Mouse Over actions – A thing of the past?

I talk to people about themes for their website, and they often express interest in some funky image swap or mouse over actions for their website.


I have to tell them that in this day of touch screen technology, what is the point? Touch screens don’t have a mouse and there fore they don’t understand the mouse over action. In fact some mouse over actions are extremely unfriendly to touch screen users. I went to a site the other day on my iPhone, which had fancy mouse over actions on the menu tabs… but of course this was not apparent/intuitive to someone that was not familiar with the site. When you tapped the screen on the tab thinking that you would be navigating to the page, the page reloaded and simply apply the graphic change to the button. It wasn’t apparent what had happened. In fact it was extremely confusing. Needless to say, I didn’t hang around that site.


With the iPad selling by the thousands in the US…

In the United States, the device has proven more popular than some analysts had expected, selling 500,000 units in the week after its April 3 launch.

…and soon to go on sale here in Australia (approx the end of May 2010) and it being sold on the pretense of being the ultimate web browsing device.


People’s sites that are heavy in mouse over actions are going to suffer as users find them unintuitive and hard to navigate. And let’s not forget Windows 7. One of the primary inclusions in the OS is to support touch screen monitors!


So, the touch screen market is growing in leaps and bounds and website developers need to keep pace. Steer away form funky image swap and mouse over actions. Including flash animations that include mouse over detection to activate aspects of their graphical content (let’s not forget that none of the Mac touch screen devices support flash content on websites anyway – something that I am actually glad of).


Keep WordPress themes attractive yet simple! Be user friendly to touchscreen and mobile devices!

.

Moving your WordPress installation to another location

It’s actually very simple to move a WordPress website/blog to a new location…
Be it to a different path on the same server, or to a totally different server.


Steps:

  • Create a backup of the current site files (i.e. if WordPress is installed in the root of the webserver this will be the public_html directory). You can use the File Manager functionality in you site’s Control Panel to zip the directory and contents and download it to your desktop. Or you can use an ftp program… but zipping it will halve its size and you will be able to download it a lot quicker.
  • Create a backup of the MYSQL database that your site is currently using. You can use the MYSQL manager in your Control Panel to do this. The backup file that you end up with must have the .sql extension.
  • Go to the new location where you are moving the site to and upload the backup of the sites files. If you used File Manager to zip the files, you can upload the zipped directory and use File Manager in the new location to unzip the files. If you are moving to the root of the new location, then once again, you will be uploading the files into the public_html directory.
  • Create a MYSql database on the new server. You can use the MYSql admin functionality in Control Panel to do this.
  • Create a new user and add it to the new database that you have just created. Make a note of the database name, the user name and the user’s password. You need this information in a later step.
  • Open your database backup (the .sql file) with a text editor. Do a search and replace all to change all reference of the old URL with the new one:
    I.e: if your old url was joeblog.com and your new location is erniesmith.net… you do a search for joeblog.com and replace all instances of this with erniesmith.net. Note: there may be thousands of replaces done, depending on the number of pages/posts in your site.
    If your not moving to the root of the new location, then adjust the replace url according ly (i.e. you may be moving it to erniesmith.net/blog).
  • After you have finished editing the .sql file, you must import it into your newly created MYSql database to ensure that the relevant tables are created to match your site files. You can use PHP MY Admin to do this. Simply view the database and select the Import option and point to your .sql file on your computer. The .sql file will be run in the new database and the relevant tables will be created.
  • Using File Manager or and ftp program, you need to open the wp-config.php file for editing: you need to edit the database reference, the user reference and the user password reference with the information that you noted in a previous step. 
    WordPress uses this information to locate the correct database when the website launches. So this new info must be correct or you will receive the message: Unable to establish a database connection when you try to launch the website.


If you don’t find these steps clear, you can watch the two videos below. They go through the process in detail. I have used this method to move numerous WordPress installations and it has worked every time.


Good luck… and happy moving!!


[youtube]http://www.youtube.com/watch?v=6hCH3FQhiBI[/youtube]

[youtube]http://www.youtube.com/watch?v=qZ10dufMAVY[/youtube]


.

WordPress – Removing the default ‘Home’ link from the page menu

Many WordPress themes create a page link in the menu bar titled ‘Home’.

If, like me, you set up page driven websites, and you title your home page ‘Home’, then this creates two ‘Home’ pages in the menu.


It’s very simple to remove this default ‘Home’ menu link…


Simply ‘rem’ the code below in green from the active theme’s header.php file:

Refresh your page, and the home link will be removed.


Note: You must be sure to go to:
Settings > Reading and set your ‘Front page displays‘ option to ‘A static page
Front Page: Home


This will ensure that whenever someone visits your site, the first page that is displayed, is the Home page that you have created.


.

WordPress – Hiding the ‘Page Title’

Note: This fix does not work for Artisteer generated themes. There is another post for that.


Use: If you don’t want the page title to be displayed on each page… it looks particularly out of place when you set a static page to be your home page… you title the page ‘Home’… when you navigate to the home page you have Home in a large label at the top of the page.
The code that you need to comment out in the page.php file is:
<!--<h2><?php the_title(); ?></h2>-->
It is located in the post <div


.

WordPress – Stop the name and description from appearing in the site header

Use: If you want to replace site a header containing a background colour with an image, and you don’t want the text to display over your new image.


You need to comment out the following code in the header.php file:
<!–<h1><a href=”<?php bloginfo(‘url’); ?>”><?php bloginfo(‘name’); ?></a></h1>
<h2><?php bloginfo(‘description’); ?></h2>–>
This code is in the header <div


.

WordPress – Including ‘categories’ in the main page tabs

By default, the categories are not included in the main page tabs (for most theses).

If you want to include your categories so that visitors can access them easily and intuitively, you can ad this line of code to the header.php file:

<?php wp_list_categories('orderby=order&title_li='); ?>

It goes into the navigation <div

The sub categories will appear nested under the main category tabs.

If your using a theme generated by Artisteer…
The code could look like either of these two examples:

======================================================================

<ul class=”art-menu”>
<?php art_menu_items(); ?>
<?php wp_list_categories(‘title_li=</li><li><a><span class=”l”></span><span class=”r”></span><span class=”t”>Categories</span></a>’); ?>
<li><a><span class=”l”></span><span class=”r”></span><span class=”t”>Archives</span></a><ul>
<?php wp_get_archives(‘type=yearly’); ?>
</ul></li>
</ul>
======================================================================


<div class=”art-nav”>
<ul class=”art-menu”>
<?php art_menu_items(); ?>
<?php wp_list_categories(‘title_li=</li><li><a><span class=”l”></span><span class=”r”></span><span class=”t”>Collectables</span></a>’); ?>
</ul>
</div>
(where Collectables is replaced by what yo want the tab to be named)

======================================================================

.

WordPress – Inserting a frame into a page

The answer is simple, and the code looks like this:

<iframe src ="<enter-your-url-here>" width="100%" height="400">
     <p>Your browser does not support iframes.</p>
</iframe>

One thing to watch out for though…
The WordPress editor does not support frames in the ‘View’ tab. So you must enter the code in the ‘HTML’ tab, and not toggle back to the view tab. Otherwise the code will be invalidated. A small price to pay for an easy and very handy piece of functionality.


.

Follow Jaime on Twitter
Stand out from the crowd
Log in to your cPanel
Sea Shepherd