Skip to content

Instantly share code, notes, and snippets.

@scottnix
scottnix / gist:1997848
Created March 8, 2012 01:26
Thematic Theme Framework HTML5 Boilerplate Header
// recreates the doctype section, html5boilerplate.com style with conditional classes
// http://scottnix.com/html5-header-with-thematic/
function childtheme_create_doctype() {
$content = "<!doctype html>" . "\n";
$content .= '<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" dir="' . get_bloginfo ('text_direction') . '" lang="'. get_bloginfo ('language') . '"> <![endif]-->' . "\n";
$content .= '<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" dir="' . get_bloginfo ('text_direction') . '" lang="'. get_bloginfo ('language') . '"> <![endif]-->'. "\n";
$content .= '<!--[if IE 8]> <html class="no-js lt-ie9" dir="' . get_bloginfo ('text_direction') . '" lang="'. get_bloginfo ('language') . '"> <![endif]-->' . "\n";
$content .= "<!--[if gt IE 8]><!-->" . "\n";
$content .= "<html class=\"no-js\"";
return $content;
<?php
/*
Template Name: Front Page
.
Take a look at the functions.php for this theme to see how the random content is included.
.
*/
?>
<?php get_header() ?>
<div id="container" class="feature">
@scottnix
scottnix / gist:3248716
Created August 3, 2012 15:33
Insert Header Image in Thematic Child Theme
// sizing for custom header
// http://codex.wordpress.org/Custom_Headers
$headerargs = array(
'flex-width' => true,
'width' => 1140,
'flex-height' => true,
'height' => 250,
'default-image' => get_stylesheet_directory_uri() . '/images/header.png',
);
add_theme_support( 'custom-header', $headerargs );
@scottnix
scottnix / thematic-html5
Created August 24, 2012 00:25
Thematic HTML5 - suggestion
/**
* Filter the opening tags of the widget areas
*
* Replace the div with aside, remove the wrapping ul
*
* @since 0.1
*/
function before_widget_area($content) {
$content = str_replace( '<div', '<aside ', $content);
$content = str_replace( '<ul class="xoxo">', '<div class="inner">', $content);
@scottnix
scottnix / gist:3738633
Created September 17, 2012 17:29
Thematic Override Index Loop and Single Post Loop
function childtheme_override_index_loop() {
// Count the number of posts so we can insert a widgetized area
$count = 1;
while ( have_posts() ) : the_post();
// action hook for insterting content above #post
thematic_abovepost();
echo '<div id="post-' . get_the_ID() . '" ';
// Checking for defined constant to enable Thematic's post classes
@scottnix
scottnix / gist:3745204
Created September 18, 2012 19:18
Gallery Theme remove bottom nav
// add custom WP 3.0 menus
function gallery_navigation() {
global $post;
if ( !is_single() ) : ?>
<div id="nav-below" class="navigation">
<?php if(function_exists('wp_pagenavi')):
@scottnix
scottnix / gist:3750712
Created September 19, 2012 16:46
Thematic Theme Excerpt Read More on both manual and auto excerpt.
function childtheme_override_content() {
global $thematic_content_length;
if ( strtolower($thematic_content_length) == 'full' ) {
$post = get_the_content( thematic_more_text() );
$post = apply_filters('the_content', $post);
$post = str_replace(']]>', ']]&gt;', $post);
} elseif ( strtolower($thematic_content_length) == 'excerpt') {
$post = '';
$post .= get_the_excerpt();
@scottnix
scottnix / gist:3759830
Created September 21, 2012 05:11
Post Format aside, remove link from title in Thematic
function childtheme_custom_postheader($postheader) {
if ( has_post_format( 'aside' ) && ! is_single()) {
$postheader = '<h2 class="entry-title">';
$postheader .= get_the_title();
$postheader .= '</h2>';
}
return $postheader;
}
add_filter ('thematic_postheader', 'childtheme_custom_postheader');
@scottnix
scottnix / gist:3776638
Created September 24, 2012 15:48
Thematic remove Header bits.
// remove header bits, previously this was done to Thematic itself, but you aren't suppose to do that, it is as simple as.
function childtheme_remove_headerbits() {
remove_action('thematic_header', 'thematic_blogtitle', 3);
remove_action('thematic_header', 'thematic_blogdescription', 5);
}
add_action('init', 'childtheme_remove_headerbits');
@scottnix
scottnix / gist:3795084
Created September 27, 2012 16:52
Add MM_Preload Dreamweaver to Thematic body class
// add dreamweaver preloadimages attributes to body tag
// http://thematictheme.com/forums/topic/add-onload-to-body-on-homepage-only/
function childtheme_override_body() {
echo '<body ';
echo 'onload="MM_preloadImages(\'images/home_over_button.jpg\')" ';
body_class();
echo '>' . "\n\n";
}
//