Archive for the ‘Pimp my Blog’ Category

Wider posting box - Let your admin area breathe!

Tuesday, May 27th, 2008

If you’re anything like me (and I know I am) then you love BIG monitors. My main computer is a 24″ iMac (primal grunting here). I just think that I’m a lot more productive on a big monitor. And there is scientific evidence to prove my point. But I digress…

If you have a big monitor like me, then you may have been a little frustrated when WordPress 2.5 came out and one of the new “features” was an admin working area limited to 980px. Especially when posting big, ProPhoto-sized pictures, more width can be really nice.

I already posted about increasing the write-post box’s height, but today I tried out a cool plugin that removes the max-width setting on your admin area.

You can download it here. I like it! What do you think?

Related posts:
Increase the size of your post-writing box
Installing and using plugins

Redirect your old Blogger blog to your new WordPress blog

Wednesday, May 14th, 2008

A lot of you switched from Blogger (blogspot.com) blogs to WordPress in order to use the ProPhoto theme.

If you’re anything like me (and I know I am) you probably just posted one last time on your old blog saying “Our blog has moved!” and putting a link to the new address. Well, I was thinking today there’s got to be a better way, so I dug around a bit, found a few posts, and came up with this for my wife’s old blog: Click here to see it. Go ahead, click on it and come back here.

Pretty cool, eh? Here’s how to do it:

Log into your old Blogger dashboard and click on Manage: “Template” for the blog you want to redirect, as shown below:

Then, hunt around in the big editable text box, and just below the tag that says <head>, paste in these two lines:

<meta content='1;url=http://www.website.com/blog/' http-equiv='refresh'/>
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW"/>

Be sure to change the address (highlighted in red) to your new blog’s address. The second line tells search engines not to read or index your old blog. This assumes that you’ve imported your old blogger blog into your WordPress blog. Search engines penalize you some for duplicate content (having the same exact content appear in several places on the internet) so this takes care of that. If you didn’t import your old blogger blog into your WordPress blog, then you can leave this line out. Also, the number “1″ in the first line is how many seconds the user will wait before they are redirected. You can adjust this if you want.

This code takes care of redirecting browsers to your new blog. Next we have to insert one more bit of code to display that cool yellow box so they know what’s happening to them.

To do this, scroll down a bit further and find a line that says:

<b:section class='main' id='main' showaddelement='no'>

Right below that line, paste in this chunk:

(NOTE: if you are still using an ancient Blogger template like I was, you might not have this line of code. Instead, just insert it right below the <body> tag.)

<div style='position: absolute; top: 0; left: 0; margin: 30px; border: solid 2px #333; color: #000; background-color: yellow; padding: 25px; width: 85%; z-index: 5; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 14px;'>
<p><strong>My blog has moved!</strong></p>
<p>You should be automatically redirected in a few seconds. If not, visit<br/> <a style="color:red;" href='http://www.website.com/blog/'> <strong>http://www.website.com/blog/</strong></a> <br/> and update your bookmarks.</p></div>

Again, be sure to change the website address twice in the above code (highlighted in red) to your blog’s address. Click save changes, and check your work.

Questions? Leave ‘em in the comments and I’ll try to get back to you in a jiffy.

How to add a signature image to your bio

Wednesday, May 7th, 2008

Kelly emailed me today asking how to add a signature image to her bio text area. I thought it was a good question, and something a few of you might like to know how to do, so I’m writing up the answer here.

I think the look Kelly is going for is something like what I did with Paige Elizabeth’s blog, shown here.

See the cute little signature below her bio? Pretty cool, huh?

Well, to pull this off yourself, first, create a signature image. Try to keep the file size fairly small, although the dimensions can be whatever you want. Write down the exact pixel dimensions (width and height) of the image–you’ll need them later.

Next, we’re going to upload the image to your website. Now, you could just use an FTP program or a file manager to upload your image, but for those of you who are a little bit intimidated by such things, here’s how to do it without leaving your comfy WordPress admin area.

To upload your image, just write a new post and save it as a draft. In that new post, upload your signature image and insert it, full-size, into your post, just like you were posting an image in a regular blog entry.

Once the image is inserted into your post, switch your post into “HTML” mode (”Code” in WP 2.3.3 and earlier) by clicking on the tab at the top of your posting box. You should see a bunch of code that looks like this:

<a href="http://www.myblog.com/wp-content/uploads/2008/05/picture-12333.jpg" title="picture-12333.jpg"><img src="http://www.myblog.com/wp-content/uploads/2008/05/picture-12333.jpg" alt="picture-12333.jpg" /></a>

Click and drag in that code to highlight the text in between the quotation marks right after “src=“, shown here marked in red:

<a href="http://www.myblog.com/wp-content/uploads/2008/05/picture-12333.jpg" title="picture-12333.jpg"><img src="http://www.myblog.com/wp-content/uploads/2008/05/picture-12333.jpg” alt=”picture-12333.jpg” /></a>

That’s the address of your signature image that you just uploaded. (It might look a little different, don’t worry.) Copy that text into WordPad or TextEdit for a few minutes. Save your post as a draft in case you copied wrong and need to come back and grab that code again. Once you’ve got everything working, you can delete the post entirely–I’m 98% certain the image you uploaded won’t be deleted when delete the post.

Ok, we’re getting close.

Next, in your WP Admin area, go to “Design” => “Theme Editor” and choose the file “bio.php” to edit it. Near the bottom of that file, look for the end of the last paragraph of your bio, which is marked by a close paragraph html tag that looks like this: </p>.

After that </p> tag but before the two </div> tags, paste in this line.

<img src="http://www.myblog.com/wp-content/uploads/2008/05/picture-12333.jpg" width="50" height="50" id="mysignature" />

Once you’ve pasted that in, just replace the text after “src=” with the text you copied out of your draft post when you uploaded your signature. Also, change the width and height to the dimensions you wrote down when you created the image. Click “update file” to save your changes. Then just view your blog and refresh your browser to see your work.

If you’re really particular about exactly where the signature is placed relative to your text, you can reference this image from your stylesheet and fiddle with its margins a little bit. To do that, just go to your “Theme Editor” again, and edit “Stylesheet (style.css).” Pull down to the bottom of the document, press return to add a new blank line in and paste in these lines:

#mysignature {
margin: 0px 0px 0px 0px;
}

Then, just change those 0’s to different pixel amounts, and experiment by saving your changes and refreshing your browser to see changes. The four zeros represent, in order: top margin, right margin, bottom margin, left margin

Have a random bio image displayed each time your blog is viewed

Thursday, April 24th, 2008

One cool feature on some blogs is having a random bio picture display each time you refresh or load your blogs home page. Examples are: my wife’s blog, and spencer’s blog. (I coded my wife’s, but Spencer did his own.) Refresh the pages to see the new bio pictures load. In the past I’ve always accomplished this using a bit of moderately complex (to a non-developer) external javascript.

Yesterday I was working on coding something like this up again and thought of a way that was much simpler than writing some javascript, so simple in fact that I figured with a short tutorial, any of you could pull it off yourselves. So here goes.

First, in your WP Admin area, go to “Design” (”Presentation” in old WP versions) –> “Theme Editor” and select the file called “bio.php”.

Then, on the the line that says:

<img src="<?php bloginfo('template_directory') ?>/images/biopic.jpg" width="215" height="312" id="biopic" />

Insert your curser right between “biopic” and “.jpg” and add in this text:

<?php echo(rand(1,5)); ?>

So that the line now looks exactly like this:

<img src="<?php bloginfo('template_directory') ?>/images/biopic<?php echo(rand(1,5)); ?>.jpg" width="215" height="312" id="biopic" />

Then, all you need to do is use a file manager or FTP program to upload 5 bio pictures with the exact same dimensions (312px tall by 215px wide) into your “prophoto/images” folder. The path to that folder is this: yourblogdirectory/wp-content/themes/prophoto/images.

Name them (THIS IS IMPORTANT!) exactly biopic1.jpg, biopic2.jpg, biopic3.jpg, biopic4.jpg, and biopic5.jpg. You probably already had an image uploaded called “biopic.jpg”. This image will no longer be used if you are randomizing them according to these instructions. To continue to use that image as one of your random images, you’ll need to rename it biopic1.jpg or one of the other numbered names.

If you want more or less than 5 images, you can upload more or less, but start with “biopic1.jpg” and move up sequentially from there. If you are using a number of images other than 5, then you will also need to edit the second number of the code you inserted earlier so that it says

<?php echo(rand(1,7)); ?>

…if you want 7 images, or the second number can be whatever number you want.

A little fuzzy on how to upload images into the right folder using a file manager or FTP program? Check out:

Tutorial on using a File Manager Utility

Tutorial on using an FTP program

If you’re having any trouble getting this to work, put your question in the comments instead of emailing for support. Hope this was helpful!

Firebug tutorial video

Monday, April 21st, 2008

Firebug is a free extension for the Firefox web browser that allows you to inspect, edit, analyze, and debug any website. It has a truly awesome set of features that includes:

  1. mouse over page elements to visualize invisible attributes like height, width, padding, and margins
  2. inspect html, css, javascript for any element
  3. edit css, html and view changes in real time
  4. find height and width of any element
  5. turn off and on individual CSS styles to see the effects
  6. find exact line numbers and names of stylesheets referenced by CSS
  7. lots, lots more

Every single web developer I know uses firebug on a daily or near daily basis. Whenever I get an email from one of you asking why this part or that part of your blog looks funny, I almost always turn on Firebug to quickly determine what the issue is, and usually can test a fix without ever leaving Firebug.

But Firebug is also great for non-developers who like to hack at their code. If you’re just trying to make a few small changes and don’t know much about HTML or CSS, Firebug can be a lifesaver. It allows you to try out all sorts of little changes to your websites code, without actually making those changes. If you get things working in firebug, you can just go and edit the actual files in the same way.

A lot of photographers do tinker with their own websites, and I think that very very few of them know about this invaluable tool. I made the following tutorial video to help you get a quick overview of the basics of installing and using Firebug. Let me know if this was helpful!


How to center your post-titles

Saturday, April 19th, 2008

Someone just emailed me and asked how she would center her post-titles. I thought it was a good question, so I’m sharing the answer with all of you.

If you want to center your post-titles and post-dates, so they look like this:

Just open up your “Stylesheet (style.css)” with your Theme Editor (under the Design tab) and add a line at the bottom and paste in this code:

h2.entry-title, h3.entry-title, div.entry-date { /* center post titles & dates */
text-align:center;
}

If you only want the title centered and not the date, change it to this:

h2.entry-title, h3.entry-title { /* center post titles */
text-align:center;
}

Click update file and you’re set!

How to show full posts on WordPress archive and category pages

Monday, April 14th, 2008

I’ve been asked a couple times how to force ProPhoto to show full posts when people visit your archive or category pages. Right now, the default for ProPhoto is to show excerpts of the posts in the category and archive pages. So, when a user clicks on an archive month, this is what they see:

default theme behavior: excerpted archives

If you want to change this so that the full posts are seen, in your WP Admin area, you’ll need to go to your “Design” tab (”Presentation” in WP 2.3.3 and earlier) and select “Theme Editor.” Then choose the file called “Archive (archive.php)” to edit it. (NOTE: don’t get confused with the file called “Archive (archives.php)” - they are named almost exactly the same - you want the one that is not plural.) In that file, look for a line that says:

<?php the_excerpt(''.__('Read More <span class="meta-nav">&raquo;</span>', 'ProPhoto').'') ?>

Delete it and then paste in this line:

<?php the_content() ?>

Click “update file” to save your changes and then check your work.

You can also do this with your category pages as well. Just open up the file “Category Template (category.php)” and do the same edit.

A word of caution, however. The ProPhoto theme was built to display excerpts only on these pages for a reason. That reason is to avoid ‘duplicate content,’ which search engines don’t like, and which can get you a small penalty in Google and other search engines. Basically, the issue is, search engines don’t like it when websites have multiple pages with exactly the same content. That seems spammy to them, because a lot of spammy websites have hundreds of pages of duplicate, computer-generated content. When you leave your full posts open on your category and archive pages, you end up with a good deal of duplicate content, because your posts may be shown in full in 4 or more pages: your home page (or paged interior pages), your single post permalink page, your category page, and your archive page. This is why a lot of WordPress themes excerpt posts on archive and category pages. It is also why lots of blogs even excerpt posts on their home page.

Technically, the best search engine friendly way to do things is to have only your single-page permalink post page show the entire post, and have every other place show an excerpt. Now, that’s a little extreme, so ProPhoto was built to be a compromise between what’s good for your readers and what is good for the search engine robots. You’re more than welcome to change your archive and category pages to show the full post, just do it with the awareness that there is search engine optimization tradeoff. At the end of the day, most people’s blogs are for people and not search engine robots, so you may decide that ease-of-use for your readers is more important. I just thought you might like to know why the theme (and many themes) are built that way.

How to find background images for your blog

Friday, April 11th, 2008

Some people have asked me about where and how to find good background images for their blogs. Here’s a couple thoughts:

This website: http://squidfingers.com/patterns/ has a bunch of cool backgrounds that are free to download. They are all small, lightweight, tiling GIFs, which are perfect for blog backgrounds, because they follow the guidelines of my #1 all-time blog tip.

Another place you might check is http://www.sxc.hu/. That’s where I found the cool paisley background for my wife’s blog, although I had to pay a buck for it. I found it by searching for “paisley.”

To add a background image to your ProPhoto blog, save your background image as “bg.gif” and upload it into the “images” folder of the “prophoto” theme folder, overwriting the existing “bg.gif” file.  If you are using a “.jpg” instead of a “.gif” for your background image , you’ll need to modify line 29 of the “Stylesheet” (style.css) so that it says “bg.jpg” instead of “bg.gif.”

Finally, I was hoping some of you knew of some additional resources. Where do you find cool free or cheap backgrounds? Post them in the comments so we can all benefit. Thanks!

Match your background color to your background image

Wednesday, April 9th, 2008

Here’s a quick tip to help you put another little bit of polish on your blog: make sure to match your background color to your background image, if you are using one. Here’s why: If I visit Audra Little’s blog, which looks great by the way, this is what I see:

It looks very lovely with a tasteful, cool looking background image that is bright, funky yellow. But, if I’m visiting her blog for the first time, for about 1-2 seconds, while the background CSS image loads, I can see the default background color grey underneath. It looks like this:

Try it, by visiting her site. Watch the background before the image loads. (Sorry to pick on you Audra! - it’s my fault really, I should have put this in a tutorial or something.) Background colors specified by CSS load immediately (really, they don’t load, they’re just there) as opposed to background images which must be downloaded before they can be displayed.

Therefore, the optimal thing to do is to eyedrop the dominant color in your background image, and set your whole page background to this. In this case, Audra’s site would start out being a flat yellow #FFC300, and then after 1-2 seconds, the yellow image would take its place, subtly but significantly improving the look of the background. This is much better than a gray site that abruptly turns yellow after a second or two.

In case you forgot, to set your background color, simply open your Theme Editor under the “Design” tab (”Presentation” in WP 2.3.3 and earlier) and click on “Stylesheet (style.css)” to edit. Line 30 is where you edit the background color.

Adding a custom post separator image

Tuesday, April 8th, 2008

One thing I’ve been asked a few times is: how do I replace the default dotted line separating posts with a custom image that matches my branding? Like Shari’s blog, for instance, shown below:

Well, here’s how:

Step 1: Upload an image for your separator, it should be no wider than 900px, into your prophoto/images folder. Use an FTP program or your web-based file manager utility. Note carefully the name and spelling of your image, and it is case sensitive.

Step 2: in your WP Admin area, go to “Design” (”Presentation” in WP 2.3 and earlier) and click on “Stylesheet (style.css)”. (It might be a good idea to copy the whole file and paste it into TextEdit (Mac) or WordPad (PC) first as a backup in case you mess something up.) Then scroll down to line 346 to this chunk of code:

.meta-inner {
margin: 0;
padding: 0 0 25px 0;
border-bottom:1px dotted #CCCCCC;
}

Delete that chunk and replace it with this:

.meta-inner {
margin: 0px 0px 1px 0px;
padding: 0 0 85px 0;
background: url(images/myFile.jpg) no-repeat center bottom;
}

Except put your own file name and extension (.jpg,.gif, or .png). Then, just fiddle with the bottom padding (”85px” on the third line) until it looks right–this will probably need to be at least as many pixels as your image is tall. You may want to add some margin below the image as well, which you can do by fiddling with the “1px” on the second line.