One of my all time favourite themes is AutoFocus by Allan Cole – it’s a superb portfolio theme that lets your pictures to the talking. Great for sites that show off images.
I wanted to use it over at Cloud-TV but thought that a different colour scheme would better suit my pictures – so I took some notes on how to amend certain aspects of the theme. You may find these useful if you’d like to style the theme to your own needs.
Please note that at the time of writing AutoFocus is at Version 1.0.1 – it is likely to be the final standalone theme and it’s no longer under active development. These tweaks will NOT work for Autofocus Plus or Plus Pro.
Version Differences
There are THREE different versions of Autofocus out there:
- Autofocus 1.0.1 available from the WordPress Repository. You can get this simply by searching for “autofocus” under Appearance – Themes – Install New Themes. This is the version I’m discussing here. It is no longer in active development.
- Autofocus Plus (or Autofocus+) available from Allan Cole’s super unpronouncable site fthrwght.com. This is a child theme for the Thematic Framework. You need both these themes to run it. This version is in active development but not discussed here.
- Autofocus Plus Pro (or Autofocus+ Pro) also available from Allan’s site for a small fee.
I know this is confusing… that’s why I’m mentioning it here. Functionality is very different for the Plus version, which which we are not discussing in this article.
Background Colour
For my project I needed a darker background colour like grey. Have a look in the style.css file for these lines under the /* =structure */ section:
body{background-color:#FFF;color:#444;font:1.4em/1.6 "Hoefler Text", "Georgia", Georgia, serif, sans-serif;margin:0;padding:0}
Change the background-color value (#FFF) to something else like #333 to change its colour. Doing this will require a bit of tweaking on the old Page Titles – I’ll explain that further down.
If you’d like to add a background graphic, add the following code inside the {} brackets:
background-image: url('http://yoursite.com/picture.jpg');
Website Title
To change the size of your website title, have a look at this line of code under the /* =header */ section:
#header h1 {font-size:1.8em;line-height:0.8em;padding:5px 0 0;}
Change font-size to 3.8em for something with a lot more impact. The title is defined by the default link colour (since the title is a link) – if you’d like to change this independantly from the link colour, add this bit of code (it’ll make the title red):
#header #blog-title a {color:#f11;}
If you’d like to change the colour of the tag line, change the value in this bit of code:
#header #blog-description {color:#888;}
Adding a Header
To add a header graphic to this theme, have a look at the header.php file and find this bit of code:
<div id="header">
<h1 id="blog-title"><a href="<?php echo get_option('home') ?>/" title="<?php bloginfo('name') ?>" rel="home"><?php bloginfo('name'); ?></a></h1>
<div id="blog-description"><?php bloginfo('description') ?></div>
</div><!-- #header -->
Change the second line to something like this:
<h1 id="blog-title"><a href="<?php echo get_option('home') ?>/" title="<?php bloginfo('name') ?>" rel="home"><img src="http://yoursite.com/yourlogo.jpg"></a></h1>
Make sure your header is not too big, otherwise it’ll obscure the nav menu. Delete the second line if you don’t want WordPress to display your tag line.
Default Link Colour
To change this, go back to the style.css file and have a look for this inside the /* =miscellaneous */ section:
a{color:#444;display:inline;}
a:hover{text-decoration:underline;color:#000;}
You guessed it: the first line changes the link colour, the second line deals with what happens when you hover. Sweet! Notice that changing either value will have an effect on the site title and all items in your Nav Menu, unless you override those individually.
The Nav Menu
The Nav Menu is called from within the header.php file via a function which lives in the functions.php file. Here’s the full php code you need to find:
// Produces a list of pages in the header without whitespace
function sandbox_globalnav() {
echo '<div id="menu"><ul><li><a href="'. get_settings('home') .'/" title="'. get_bloginfo('name') .'" rel="home">Home</a></li>';
$menu = wp_list_pages('title_li=&sort_column=menu_order&echo=0'); // Params for the page list in header.php
echo str_replace(array("\r", "\n", "\t"), '', $menu);
echo '<li><a href="'. get_bloginfo_rss('rss2_url') .'">RSS</a></li></ul></div>';
}
By default, every page you’ve got in your WP installation will be shown. That may not be what you want. Instead, you could write a link to every page you want to show like this:
function sandbox_globalnav() {
echo '<div id="menu"><ul><li><a href="'. get_settings('home') .'/" title="'. get_bloginfo('name') .'" rel="home">Home</a></li>';
?>
<li><a href="yoursite.com/page1/">Your First Page Here</a></li>
<li><a href="yoursite.com/page2/">Your Second Page Here</a></li>
<?php
echo '<li><a href="'. get_bloginfo_rss('rss2_url') .'">RSS</a></li></ul></div>';
}
If you don’t care for the RSS Link at the bottom of that block, delete the entire line and replace it with
echo '</ul></div>';
You can also change the size and colour of the entire nav block – have a look at the sttle.css file for this. Under the header section you’ll find a block of code – we’re only interested in the very last line which describes text in the nav menu:
/* =header */
...
#access #menu a{font-weight:800;}
If you wanted to make it red and slightly bigger for example, amend that last line to this:
#access #menu a{font-weight:800; color: #f00; font-size: 1.2em;}
Add tags to your heart’s content.
Pages: 1 2




← Previous Comments
Next Comments →
Hi Jay,
Thanks for the tip before! I was wondering if there was a way to link pictures on the home page to pages, instead of posts?
I was also wondering if there was a way to categorize posts into separate pages and only have them show up on those pages? (For example, if I categorize a post as “photos,” it would only show up under a “photos” page.)
Thanks So much!
What you want is a category archive rather than a page. In WordPress, a page is similar to one post. But a post can be in a category, so you can post say 10 pictures in one category, then display the category archive which would display all posts underneath each other.
Sadly though, Autofocus only links to the individual posts rather than categories – that’s not easy to change I’m afraid.
Hi Jay!
Love the tips! I was wondering if you could help me with something. Right now on my site, whenever someone clicks on any image on the page/post, its a hyperlink that takes you to the image file. Is there any way that I can disable that, so images on the page/post are just images?
Thanks!
Lin
Hi Lin,
yes that’s very easy to do: go to edit your post and click on the picture in question. In the top left corner you’ll see two icons, a picture and a stop sign. Click on the picture icon and you’ll see a link to your full picture in the Link field. Underneath it there’s a button called None – click that, then hit update. Now update your post and your picture doesn’t link to anything anymore.
You can also use this method to make your picture link somewhere else, like to a certain post or another website.
Hope this helps
Awesome! Thanks so much Jay!
hi jay.. i used autofocus for my site and decided to change the background color to black, everything was fine except when you click on the image, there is a white block that would appear.. any idea to remove this? thanks!
That phenomenon sounds familiar… have you got a link to the site so I can have a look? I seem to remember there was something else that needed to be styled apart from the background colour.
Hi Jay,
How would I change my style sheet so that my home page is arranged like this and the my posts are this size on the home page
http://www.briannafano.com/
I want that same lay out but not sure how to get it!
Hi Alex,
this could be done in two ways: the simplest would be to use a static page as your home page. You can set this under Settings – Reading. You can then define another page as your “blog” page where it would show your latest posts, or just leave it as is if you don’t want to use posts.
Another option is to delete (or rename) the home.php file in /wp-content/themes/autofocus/ which will then remove the image grid from the front page and replace it with a list of your latest posts. If you only want to show one, set the number of posts under Settings – Reading to 1.
Depends on what you’re after. I think the site you’ve mentioned probably uses option 1.
Hope this helps
Hi Jay,
Thanks for the great help.
I’ve having some big problem since a while.
I’d like to remove the meta data at the end of every image in the frontpage.
Is there any posibility to remove this function?
Thanks.
Thank you very much, Chris!
Do you mean the big dates on the front page? You can remove those by adding this piece of code to the bottom of your style.css file:
.home .post .bigdate{display: none}Hope this helps!
Hello , and thanks for the tips.
I was wondering if it is possible that the big dates on the home page does not appear on photos, to delete it ?
Hi Fred,
yep – I think I’ve just answered this question to Chris. Add this code to the bottom of your style.css file:
.home .post .bigdate{display: none}
Hi, thank´s a lot for those awsome tipps!
How would i change the code, that the menue ist horizontal?
thanx a lot in advance!
Stefan,
I must pass I’m afraid… I’m sure it’s possible but that’s more of a heart surgery than a quick tweak. Look into Autofocus Pro, it’s only $25 and that has a horizontal menu. More importantly it has working WordPress menus so you can populate it under Appearance – Menu. You can download it at http://fthrwght.com/autofocus/
no worries, thank´s a lot for sharing all those awsome tipps!!!
Hi Jay,
Do you know if it is possible to change the font of the tagline and of the categories in the far top right hand corner of the homepage? I have bought the custom fonts and have changed the font for the title, but wanted to use the same font for the tagline and categories also…
Thanks in advance for your help – really appreciate it!
Skye
Hi Skye,
yes that’s possible, here’s a list of all the headline elemnts and an example of how to style them. I’ve made the font Arial for now, but you can change it to anything you like. Here goes for Header, Tagline and Menu:
#header h1 {font-family: Arial;}#header #blog-description {font-family: Arial;}
#access #menu {font-family: Arial;}
Add these to the bottom of style.css and replace Arial with your font of choice (you can add multiple fonts separated by commas). Hope this helps
Oh ! OkJay, sorry my English is sometimes approximative, thank you for your advice.
You’re doing very well, you should hear me try French – it’ll be MUCH worse
Hi Jay,
Thanks for getting back to me – I really appreciate it. I tried copying and pasting your text into my into my CSS Stylesheet Editor, but nothing changed. Did I do the right thing?
Thanks so much for your help (and patience) with this!
Skye
No problem Skye,
I think the snag is that you’re with WordPress.com, and as such I believe they charge you if you want to make any CSS amendments. In the self-hosted version you’d just head over to Appearance – Editor and add those lines, but in theory this should work on WordPress.com like you’ve described (in practice however it may now). Make sure they’re at the bottom of the stylesheet so these elements get re-defined.
Let me know if you’re interested in going self-hosted, I can bring in your current WordPress.com content into my WP Hosting service if you like.
← Previous Comments
Next Comments →
{ 1 trackback }