Today I ran into an interesting problem while developing a BuddyPress theme. I was attempting to include a custom sidebar using PHP’s “include” function. The WordPress codex page on “include tags” gives us this:
<?php include( TEMPLATEPATH . ‘/sidebar-index.php’ ); ?>
The problem is that the above code doesn’t always work when you are utilizing a child theme (I am building a child theme based on the default BuddyPress theme). Rather, you should use the “locate_template” hook:
<?php locate_template( array( ‘sidebar-index.php’ ), true ) ?>
What the “locate_template” hook does is searches the child theme’s template folder before searching the parent theme’s template folder.
Pretty nifty, eh?
More posts from themightymo.com
Yesterday I discovered the new Fluency 2.0 plugin for WordPress 2.7. It does a fantastic job of cleaning up the admin interface and makes the back-end WordPress experience much better for users.
We have just teamed up with one of the web’s finest search engine optimization gurus, Greg Cryns, and will now be offering his services to you, our customers! For you, our customer, this means that we now have added expertise in driving targeted traffic to your website. Greg has over a decade worth of search…
Below are my notes from tonight’s FlashMN meeting starring Dustin Tauer. The presentation focused on the new features of Adobe Creative Suite 4. Illustrator CS4 Can create multiple art boards. So, if I wanted to use artwork for the front and back of t-shirt, I would create 2 art boards (up to 100). There are…