31

Thesis Sticky Footer

by Matt Hodder on August 10, 2009 in Customization

stickyfooter

Thesis is what you make it

Lately I have been witnessing more and more complex and beautiful designs throughout the community. Thesis is really what you make it. I’ve found I can work away at a design mock up in Photoshop, and no matter what I come up with, I can replicate it in Thesis. Of course, as designs get more complex so does the development. Thesis can’t do everything right out of the box.

How to stick your Thesis footer to the bottom of the page

On it’s own, with no custom tweaks, the Thesis footer looks and feels great. It’s exactly where one would expect it to be in terms of placement. However, while designs get more complex and more elements are thrown into the mix things tend to not sit as well. Below is a shot of the standard out of the box design of Thesis. I’ve deliberately included a small amount of content and a tiny set of widgets for the example.

thesis-default

As you can see everything looks and feels great. But what if we wanted to mix things up and add a light grey background to the footer? Well let’s try exactly that and see what happens:

thesis-default-footer-shaded

Now the placement of that footer isn’t working so well. We would expect the footer to be shot to the bottom of the page no matter the content and window size, or at least have anything below the footer the same colour. Of course, if we had more content we would get the desired effect- however that’s not always the case. So what now? Alas, Thesis can’t be at two places at once, so we are going to have to leave the defaults, and tweak our custom files.

The CSS

I’ve based the CSS off one of the most widely used sticky footer solutions in web design, The CSS Sticky Footer by Ryan Fait. Taking his original CSS we are going to work it into our thesis site. First, open up the custom.css file located in the custom folder (found in the Thesis theme directory). If it’s named custom-sample, simply rename it to custom and proceed. Make sure you back up anything in that folder before continuing.

Once you have custom.css open, pop this code into the file:

html, .custom {
 height: 100%;
}
.custom .wrapper {
 min-height: 100%;
 height: auto !important;
 height: 100%;
 margin: 0 auto -100px; /* the bottom margin is the negative value of the footer's height */
}
.custom #footer_area, .custom .push {
 height: 100px; /* .push must be the same height as .footer */
}

Thankfully, that small bit of code is all you need in terms of CSS. Obviously you can change the height of the footer to your preference. Make sure if you change the height, to also change the .custom .wrapper margin as well (as shown in the comments). Right now you won’t get anything if you tried to refresh your Thesis page- as we haven’t created the wrapper or push containers that are referenced in the CSS.

The PHP

In that same custom folder you should find a separate file called custom_functions.php. Open that up and paste the code below:

add_action('thesis_hook_after_content_area', 'div_push');
add_action('thesis_hook_before_html', 'div_wrapper_start');
add_action('thesis_hook_after_content_area', 'div_wrapper_close');

function div_push() {
 ?>
 <div class="push"></div>
 <?php
}

function div_wrapper_start() {
 ?>
 <div class="wrapper">
 <?php
}

function div_wrapper_close() {
 ?>
 </div>
 <?php
}

Basically this code is creating some new layout containers for the site. The header and content area will now be wrapped in a wrapper container, with a push container placed inside. Our CSS now has it’s elements to call on and have something to “push” to the bottom of the page.

We’re Done!

Yep, that’s it. If you have a very content lacking site you now have no need to worry. If you refresh your site, you should have something that looks like this no matter the window size:

thesis-fixed-footer-shaded

The only thing you may want to change, like I said before, is the height. Other then that, you’re good to launch your site and see your changes. This technique should work in all major browsers and even IE6. If you have any questions, fire them in the comments section below.

Read More
3

How to Troubleshoot Your Code

by on August 4, 2009 in Thoughts

Day 486 / 365 - Late Night High Level Coding

What sound does a busted website make?

I like to think that when code falls down and breaks its hip it radiates sound waves that are similar to a falling bomb – a haunting techno-ghost whistle that rattles the air as it plumes downwards and zigs through headwinds as it zooms towards the top of your head.

I also think it’s reasonable to believe that when code breaks it’s like an unwitting raspberry pie wrapped in a tin foil shell that’s been placed in the microwave – it’s own elemental properties will work against it and bounce those heat-producing waves right back into the magnetron’s core, causing universal culinary meltdown followed by septic shock and electrical system failure.

I guess what I’m saying is that you better have house insurance.

If you run a website or blog, house insurance comes in the form of a dedicated web developer/site master/internet guru that is well-versed in the art of super glue and duct tape as they pertain to websites.

But these people cost money, and if you just don’t have the budget this year to hire a specialist to surgically revive your code from the operating table, then guess what, it’s up to you to become your own specialist.

Sure, it can be scary to be confronted with all that code staring you in the face like a dog watches the mailman, but if you follow these tips, you’ll be well on your way to fixing your own problems.

How to Troubleshoot Your Code

Start with Syntax

I have lots of clients who fully understand the principle of copy and paste. So they copy code that someone wrote in a tutorial and paste it into their own file. In the perfect world, that would work fine. But in reality, doing so can cause a lot of problem.

Missing syntax is often to blame, so the first thing I do when I either have a problem of my own or get referred to one via a client is dig into the syntax. I start with the obvious: is everything in the correct format i.e. for CSS selector { property: value; }. Other things to look for include missing apostrophes or quotes, broken links and misspelled words (it happen pretty oftne).

For Thesis theme users, I see a lot of new users have trouble understanding how to write functions into their custom_functions.php file , especially since the line: add_action(‘thesis_hook_whatever’, ‘function_name’); is syntax-heavy and most users’ eyes glaze over all those apostrophes.

Now that your syntax is solid, what if your site still doesn’t show up as you’d like?

Follow Your Own Path

Take a look at your image sources and make sure that they’re all working. You should be able to copy the image source into your browser and see an full size view of your image. If that doesn’t happen, then you’ll need to correct the path.

What’s Next?

With the basics covered, if your site is still not showing up properly then it could involve a myriad of issues. You could try to toss a few emails back and forth with website fixers, but that can be and often is very time consuming. The time you’ll waste trying to determine the problem could take up to a week, and in the mean time all of your customers will be faced with an off-looking site. Yikes. If that’s not a scary thought to a web-based business then I don’t know what is. Your best bet is to…

Get Help

If you’ve gone through your syntax and carefully covered your code, you’ve probably spend a big chunk of time working on code that you could have spent more productively growing your business. There comes a point when you have to decide if it’s better to keep working on it yourself or call in a professional. When time is an issue, hire a professional who can jump in and get the job done. Sure, it will cost a bit, but you will be able to free up your time to work on your specialty – growing your business, and that is priceless.

Read More
0

Thesis Guest Writers Wanted

by Mark Hodder on July 24, 2009 in Updates, Wanted

Do you know Thesis? Do you have a way with words? Then we’re looking for you! ThesisThemes.com is looking for talented writers to publish some guest posts.

ThesisThemes.com is a rapidly growing site that launched the first week of June 2009. In that short time we’ve grown to over 20,000 page views a month and growing of highly targeted Thesis traffic.

We’re looking for someone that can write interesting tutorials and guides for Thesis users from basic to advanced. In return we’ll offer up a author profile at the end your posts which will include a link back to your site and a short bio. If you’re looking to get your name out there, this is a great way to get some extra exposure in the Thesis community. If your interested drop us a line with what you would like to cover and a sample of your writing.

Read More
2

Previous Members Reset your Passwords

by Mark Hodder on July 16, 2009 in Updates

VERY IMPORTANT: If you signed up before July 16th you need to reset your password. We had to reset everyone’s passwords to implement the new membership area. To reset your password follow these steps:

1. Request your new password by clicking here and entering your username or email in the bottom box.

2. When you have your temporary password, come back to the member login page and login in. Now click the link that says “Change Password/Edit Profile” under the Useful Links heading and enter in a new password.

That’s it!

Read More
1

New Thesis Skin – Thesis Bold!

by Mark Hodder on June 22, 2009 in Child Themes, Thesis Bold

Hey all, we have just released a new kick-ass Thesis skin that we like to call “Thesis Bold”

Along with all our other great features that you have come to love in our previous skins, Thesis Bold adds a new option to select between the orange and blue color schemes right from the options panel! Thesis Bold is available for download now in our free skins section, enjoy.

Read More
2

W3c Validator XHTML 1.0 Strict

by Mark Hodder on June 4, 2009 in Updates

Just a quick note our Thesis skins have been updated (thanks to some prodding from Bruce Keener) to pass the W3c Validator as XHTML 1.0 strict. Use the forums to post any other suggestions that you may have, we’re always open to new ideas!

* Update: We have released Fresh Company which is also XHTML 1.0 Strict

Read More