how to

Creating a 4-column layout in Wordpress

I recently got a question about how to set up a Wordpress theme with three sidebars and a content column, and since that’s not an uncommon idea but a bit tricky to figure out how to do when you’re new to Wordpress I thought I’d answer in the form of a blog post and maybe help mor than one person. :)

Read more after the jump!

Read the rest of this entry »

Giving Wordpress it´s own directory

Psst! In swedish after the “read more” link / Psst! På svenska efter “läs mer” länken!

I’ve been getting som questions about how to have your WP-install in a subfolder but without the /wordpress-suffix on your domain, mainly by people that have used some sort of auto-installer to set up their blog.

This often results in a situation where you already have a subdirectory and the blogadress is set to www.domainname.com/wordpress or corresponding. The instructions in the WP codex presumes that you are moving your WP files, sometimes making it a bit confusing for beginners to understand them.

Changing this acually isn’t that difficult, so here it goes:

First; some need-to-knows:
1. Use some kind of ftp-program to access the files.
2. To save yourself from headache – do not change any settings in the WP admin area under Settings/General until the very last step! ;)
3. The original index.php-file in /public_html/wordpress/ is to remain unaltered, you only need to copy it!
3. The root folder is commonly named “public_html” but not always. If unsure – ask your web host.
4. These instructions presumes that the folder where your Wordpress files are located is called “wordpress”, that your domain name is “yourbloghere.com” and that your root folder is called “public_html”.

Let’s get to work!

1. Go to /public_html/wordpress/ and download the file called index.php.

2. Open index.php in for example Notepad and find where it says require(‘./wp-blog-header.php’);

3. Change this into require(‘./wordpress/wp-blog-header.php’); and save the file.

4. Make sure you don’t have any files named index.html, index.php or anything like that in /public_html/. (If you do – rename them to for example index_old.)

5. Upload your altered index.php here. (Not in /public_html/wordpress/!)

6. Make sure everything is correct and that the “index.php” in /public_html/wordpress/ looks the same way it did when you started.

7. Now go to the admin area of your blog, Settings -> General and change “Blog address (URL)” to “http://yourbloghere.com”. (The “WordPress address (URL)” should be “http://yourbloghere.com/wordpress”)

8. Voilá – your done! Surf to http://yourbloghere.com/ and take a look! =)

Read the rest of this entry »

Clearing an input-field of it´s value – and then put it back.

After about 12 years of webdesigning I finally figured out a simple way of having an input-field cleared of it’s initial text value when focused and then reset when unfocused…

<input type="text" name="searchbox" id="searchbox" value="Inital text" onclick="this.value='';" onmouseout="this.value='Inital text';" />

Resulting in this:

That only took me a decade to figure out… Me stoopid. But hey, Rome wasn’t built in a day guys!! ;)

Update!

Got a tip from a reader about a better (read: less annoying…) way of doing it:

<input type="text" name="searchbox" id="searchbox" value="Inital text" onfocus="this.value='';" onblur="this.value='Inital text';" />

This clears the input at the same way, only it’s not reset until you click outside the field. Much better. :)

"It took you twelve years?!" I really think that last exclamation mark was uncalled for... *lol*