Blog Archives

Add Category class to body tag of single post template

Picked this up on the Codex: add_filter(‘body_class’,’add_category_to_single’); function add_category_to_single($classes, $class) { if (is_single() ) { global $post; foreach((get_the_category($post->ID)) as $category) { // add category slug to the $classes array $classes[] = $category->category_nicename; } } // return the $classes array return … Continue reading

Leave a comment

Changing the template for the single post template via category WordPress childtheme

Custom post types are great. But they do add extra tabs on a website. I’ve seen some dashboard disasters with large amounts of CPT tabs. You can actually sidestep CPTs and still have different single posts using different templates per … Continue reading

1 Comment

Shortcodes inside custom fields

A WordPress developer friend directed me to this post which shows how to parse shortcodes inside of custom fields. This might be really simple but it’s incredibly useful when customizing the content management experience. One more feature to preserve the … Continue reading

Leave a comment

Custom Post Types and Custom Post Templates

  UPDATE (11/28/2011): Simon Wheatley has upgraded the plugin so that you only need to update the functions.php to get templates to work on CPTs. Function is here. I’m also posting it below for reference: /** * Hooks the WP … Continue reading

Leave a comment

Embedding Shortcodes into WordPress Theme Templates

This one is pretty obvious but I only came across it a few times in the WordPress.org forums. It’s really nice to be able to embed plugin functionality right inside of templates. A good example is a Nivo slider. You … Continue reading

Leave a comment

Embedding Blog Feed Inside a Page with Custom Date Formatting

Useful if embedding a typical WordPress formatted blog inside a page. For more advanced Blog embedding use Blog in a Blog plugin. First put this function in the functions.php: add_shortcode( ‘entry-link-published’, ‘my_entry_published_link’ ); I wanted more detailed date formatting so … Continue reading

Leave a comment

Custom Post Type Archive on Homepage Page Template

Customized code from this page. This is a way to create a page template that acts as a Custom Post Type Archive. This was necessary to have a Custom Post Type Archive as a homepage which I can style in … Continue reading

Leave a comment