NOTE: My adsense account has been deactivated. And the fine folks at Google simply don’t bother explaining why they deactivate accounts – they just do it. If I ever find out why I will forward that info on. For now, I would recommend you do not use the guide I have below – in case that is the problem.
Over the past two days, I’ve put up a couple articles relating to widgetizing the twenty twelve header and guidance for adding multiple items up there while accounting for 2012′s responsive nature. I wanted to finish up today by showing my solution for running Google Adsense ads to the header while still maintaining the responsive nature of the theme as best we can, let’s dig in!
Yesterday, we started the basics for adding a widget area to the soon to be new default WordPress Twenty Twelve theme. I personally wanted to have advertising up there, plus login and registration options. I use custom login and registration pages on VoodooPress, so the standard links don’t work – I need to provide working links. I’m going to show my code for adding that login feature, of course. But I also want to show you this for a bigger reason – 2012 has a responsive setup and if you alter the theme, you need to consider that with your changes. Let’s take a look at what I have now!
WordPress 3.5 is going to drop very soon. And with it comes the new Twenty Twelve theme as default. We’ve already startedtweaking it on VoodooPress. So next up on our agenda was finding a little spot to put advertising. A widget area up top seemed like just the solution, so here is how we got that done!
A reader dropped me a comment yesterday wondering how we style the widget areas here on VoodooPress. I’m always happy to answer questions whenever I can, so we will take a look at what I do here, give a little bit of code, and even touch on other things you could do to spruce up your widget area. Let’s dive right in!
We just recently switched over to the new Twenty Twelve theme on VoodooPress, and it’s quite a nice theme! But one thing I saw immediately, it’s too narrow! I have been on a kick lately of trying to get all my sites to have nice, lightweight, clean themes. Twenty Twelve fits the bill. But it seems that everyone wants really narrow websites. A lot of folks have bigger monitors, I want to use some of that real estate. I’m not going to cover anything drastic here, but you can go as big or as small as you want with some careful planning. Note that, even though I’m showing how to make the theme wider, this will also work to make the theme narrower. Let’s dig in!
A while back, we had a pretty hand tutorial on how to work with the featured image functionality in WordPress. We covered a fair bit of useful info in that post. How to get going with the image, how to set sizes and use them, and how to display featured images. One thing we did was show, using a conditional, how to display a default image. Basically if an image isn’t set, display a selected image. A few people have asked how to actually set a default image as the featured image for a post if one isn’t set, rather than just display a default image. Here’s the trick:
I had set up an Archive page on my personal blog a while ago for folks to Explore the site with. My original intent was to give users a variety of ways, in one place, to locate content which might interest them. My secondary goal was to cut down on widgets in my sidebar. I wanted to put up some cool widgets, but also wanted to list categories, archives by date, etc. Having that all in the sidebar takes a lot of space. I thought an archive page was great way to cut down on sidebar clutter. Here’s my thought process, and some cool tips!
Here’s a nifty trick that just came through my RSS reader. Let’s give credit where it’s due first because I didn’t come up with this! It came through my reader from the WP Snippets site, this post right here. We’re going to grab the first image from the post, and set it as your featured image automagically!
When you visit the site, you can see our nifty login/out and register box at the top of the page. Go ahead, take a peak! See it there? Cool! I wanted to add that into my theme, make it easy to move from site to site, and between themes. Let’s take a peak and see how that’s done!
Here’s a quick request. Hopefully by now most of us know how to use WordPress custom menu creator. It works great, and alloows for any type of menu to be created. But let’s say you are using twentyeleven, and you are totally happy with it. And, you don’t feel like making a custom menu… you want to stick with the default fallback, wp_list_pages. The only thing that bugs you is that pesky home link…. here’s the answer!