WordPress Child Theme Basics

In this post you’ll learn all the basics of WordPress Child Themes: WordPress Child Theme file structure, how to make any WordPress Theme a blank framework, how to import Parent Theme CSS styles, how to override Parent Theme styles, and how to override Parent Theme Template files. You’ll also learn that all of this is incredibly easy and within your grasp and that it might just change how you think about WordPress and Theme development.

Continue reading “WordPress Child Theme Basics”

WordPress Menu Tricks

In this post I’m going to show you how to take WordPress Menu Editing to the next level. You’re going to learn how to use Primary and Secondary menus in your WordPress theme; Add descriptive sub-title links to your menu items like some popular WordPress themes and sites; Filter the menu of a WordPress theme; Add special CSS classes to wp_page_menu; and finally, how to hand-code your own WordPress menu for the ultimate in control.

Here’s how to make your WordPress menu jump through hoops.

Continue reading “WordPress Menu Tricks”

Take Complete Control Of Your WordPress Menu

I don’t normally post lists of plugins but for the first time ever my WordPress menu is completely controlled by WordPress itself in a smooth and efficient way. All thanks to some awesome plugins that you need to put in your WordPress management arsenal—right now. No more custom coding. No more hurried hacking when I change themes. Install these 3 plugins and stop worrying about your WordPress menu.

Continue reading “Take Complete Control Of Your WordPress Menu”

Customize Your Posts Without Touching Your Theme Files

I hate editing my WordPress theme files—and I’m a theme developer! It makes it a pain to update the theme when a new, better version comes out. And if you ever change your theme you’re either going to forget about some crucial edit you’ve made, or spend wasted hours hunting down all your customizations. Didn’t we decide to use WordPress because it was so simple to use?

Well, it is simple to use. The secret is to write a quick plugin. The really big secret is it’s not that hard.

Continue reading “Customize Your Posts Without Touching Your Theme Files”

Adding Class To The WordPress Page Menu

Problem: You need to add a class or id to the the unordered list in wp_page_menu. Maybe to implement some super-slick drop down page menus. But! That <ul> tag is trapped inside of wp_page_menu. What are you going to do?

Solution: Filter wp_page_menu. In the code example below we’ll use preg_replace to find the first—and only the first—<ul> tag and swap it out for <ul id="nav" class="something-classy">. Just drop this code snippet into your theme’s functions.php file and you’re set.

// Add ID and CLASS attributes to the first <ul> occurence in wp_page_menu
function add_menuclass( $ulclass ) {
  return preg_replace( '/<ul>/', '<ul id="nav" class="something-classy">', $ulclass, 1 );
}
add_filter( 'wp_page_menu', 'add_menuclass' );

How I Used A Custom Page Template To Redesign My Blog The Smart Way

The custom front page is a must for really taking control of your WordPress installation and using it to manage your website. Luckily, creating a custom front page is ridiculously easy. It’s something every WordPress tinkerer should tackle at least once.

Take a look at the custom front page I created for ThemeShaper. I’ll tell you exactly how I created it using a custom page template and even let you download the one I’m using here.

revenge-screenshot

Continue reading “How I Used A Custom Page Template To Redesign My Blog The Smart Way”

Collapsing WordPress Widget-Ready Areas & Sidebars

Problem: Theme users need as many widget-ready areas as possible. They’re easy to use and they help keep theme template files clean. But! unused, empty, widget-ready areas, areas waiting for you to add a widget of your choice, hang around waiting to spoil your designs by limiting your styling options. Just as bad, empty widget areas can invalidate your markup. But don’t worry, we can do something about it. Only first, we need to take a closer look at the problem.

Here’s how a typical widget-ready sidebar looks. I’ve taken the code from Automattic’s guide to widgetizing WordPress themes.

<ul id="sidebar">

 <!-- likely awesome stuff -->

</ul>

We’ve got an unordered list and inside of it a statement that looks for the dynamic_sidebar() function. If we’ve registered one, it’ll spit out our awesome stuff: WordPress widgets marked up as list items.

All very good. But what if we start out with no awesome stuff in there? No default widgets? Well, that means our containing ul element will be hanging out there in our site with no li elements in it. A list without list items. Totally invalid and totally unsemantic. Worse yet: what if you were styling that ul with a margin, border, or just positioning it? That styling would stick—even if the widget area was empty. Totally unacceptable.

Thankfully, there’s a fix. Continue reading “Collapsing WordPress Widget-Ready Areas & Sidebars”

Custom WordPress Hooks and Filters in Thematic 0.6

Thematic version 0.6 is an upgrade I didn’t intend on making so quickly and there’s been some changes. Here’s a weird one: when every other WordPress theme author is desperately trying to add more and more settings to their theme options page, I took an option out. Even weirder: it made the theme better. How? I started adding custom hooks and filters to Thematic.

This is something I’ve wanted to get started on for a while so I’m glad it’s finally here.

Custom WordPress Hooks in Thematic 0.6

There are two new custom WordPress hooks in Thematic version 0.6: thematic_belowheader() and thematic_abovefooter(). You can find them in header.php and footer.php, respectively. I’m really excited about this small—but powerful—addition to Thematic. Almost anything you can think of can now be loaded into the theme, just below the header and just above the footer, by taking advantage of your Child Theme functions.php.

Now, I haven’t done anything exciting or creative with this yet—that I can show you—but here’s the outline of some functions that’ll get you started on taking advantage of the new hooks. Remember, these go in the functions.php of your Child Themes.

// Hook into the area below the header
function childtheme_helloworld() { ?>
     <h2>Hello World!</h2>
<?php }
add_action('thematic_belowheader','childtheme_helloworld');
// Hook into the area above the footer
function childtheme_goodbyeworld() { ?>
     <h2>Goodbye Cruel World!</h2>
<?php }
add_action('thematic_abovefooter','childtheme_goodbyeworld');

There you have it. That’s all you need to get started with the Thematic custom WordPress hooks. Fool around with it. Try it out with WordPress conditional tags. See what you can come up with.

Now for the filters. I think you’ll be impressed with the power filters give you over your theme. Continue reading “Custom WordPress Hooks and Filters in Thematic 0.6”

WordPress Theme Release Post Template

In response to How to get featured in our Daily Releases on Weblog Tools Collection, I’ve made a template for posting your WordPress theme releases to the Weblog Tools Collection forum that will help ensure you get your Theme featured there. Here it is for anyone that wants to use it. Enjoy.

WordPress Theme Authors: In response to How to get featured in our Daily Releases on Weblog Tools Collection, I’ve made a template for posting your WordPress theme releases to the Weblog Tools Collection forum. Here it is for anyone that wants to use it. Enjoy.

<strong><a href="" title="Theme URL">Theme Name</a></strong>
License: license-type

Short description of the theme. Widget ready? Supports gravatars? Options page? One, two or three column theme? What colors is it available in? Is the header customizable?

<ul>
<li>Point one</li>
<li>Point two</li>
<li>Point three</li>
</ul>

<a href="" title="Theme Demo">Theme Demo</a> or <a href="" title="Theme Screenshot">Screenshot</a>

Feel free to use or adapt for your own theme releases.

Hide all your links

Want to concentrate solely on typography and foundational structure while you’re designing your next WordPress theme? Hide all your links. Make them black. Get rid of the underline and make them blend in. Destroy all visual evidence of hypertextuality. Show no mercy as you attack the lists and paragraphs and headings that shore up your content and don’t let anything distract you from your end goal: typographic excellence.

Assuming you’re starting with a white background and black text, CSS makes it relatively easy to exterminate anchors with extreme prejudice:

a {
color:#000;</code><code> text-decoration:none;
}

There. Now go make something beautiful.

While you’re at it, try hiding your header and sidebar in The Ultimate WordPress Theme Test.