Skip to content

Instantly share code, notes, and snippets.

@scottnix
scottnix / gist:6656585
Last active December 23, 2015 15:39
Example of loading scripts from Child Theme
// thematictheme.com/forums/topic/correct-way-to-prevent-loading-thematic-scripts/
// remove built in drop down theme javascript
function childtheme_remove_superfish(){
remove_theme_support('thematic_superfish');
}
add_action('wp_enqueue_scripts','childtheme_remove_superfish', 9);
// script manager template for registering and enqueuing files
@scottnix
scottnix / gist:6639057
Last active December 23, 2015 12:59
Thematic Widget above header.
// reference http://thematictheme.com/forums/topic/add-custom-widget-area-to-top-of-website/
// add a widget to the top of the site
function childtheme_add_thematic_aboveheader_widget($content) {
$content['Top of site widget'] = array(
'admin_menu_order' => 232,
'args' => array (
'name' => 'Top Of Site Widget (Twitter)',
'id' => 'tweets',
'description' => __('The widget area above the subs/footer.', 'thematic'),
@scottnix
scottnix / gist:6437600
Created September 4, 2013 14:19
Thematic/WordPress change default excerpt length
// change the excerpt length, default WP value is 55 words
function childtheme_excerpt_length($length) {
return 5; // 5 words
}
add_filter('excerpt_length', 'childtheme_excerpt_length');
@scottnix
scottnix / gist:6432506
Created September 4, 2013 03:35
Thematic show Excerpt on Home/Blog
// show excerpt post instead of excerpt on homepage
function childtheme_thematic_content($content) {
if ( is_front_page() || is_home() ) {
$content= 'excerpt';
}
return $content;
}
add_filter('thematic_content', 'childtheme_thematic_content');
@scottnix
scottnix / gist:6259811
Last active December 21, 2015 05:49
Thematic move access menu above branding div.
// remove access menu from current position
function childtheme_move_access() {
remove_action('thematic_header', 'thematic_access', 9);
}
add_action('thematic_child_init', 'childtheme_move_access');
// add access menu back into the same header, but on a different priority
add_action('thematic_header', 'thematic_access', 0);
@scottnix
scottnix / gist:6203162
Last active December 20, 2015 22:09
Remove User Agent sniffing from Thematic Theme
<?php
// remove user agent sniffing from thematic theme
// this is what applies classes to the browser type and version body classes
function childtheme_show_bc_browser() {
return FALSE;
}
add_filter('thematic_show_bc_browser', 'childtheme_show_bc_browser');
@scottnix
scottnix / gist:6201993
Last active December 20, 2015 21:59
Adding a script to Wordpress, with page conditional
<?php
// add script to WP with a page conditional
// thematictheme.com/forums/topic/adding-javascript-to-style-an-element/
function childtheme_add_shit_to_head() {
if ( is_page( 80 ) ) { ?>
<script>Script....</script>
<?php }
}
@scottnix
scottnix / gist:6067940
Last active December 20, 2015 03:59
Thematic Theme remove sidebars on Single Pages
<?php
// remove sidebars on single pages in thematic
function childtheme_thematic_sidebar($show) {
if ( is_single() ) {
$show = false;
}
return $show;
}
@scottnix
scottnix / gist:6047534
Last active December 20, 2015 01:09
Thematic postfooter, only show category/categories
<?php
// remove all postfooter information except for post category
// thematictheme.com/forums/topic/post-footer/
// override, show only categories in postfooter
function childtheme_override_postfooter() {
$post_type = get_post_type();
$post_type_obj = get_post_type_object($post_type);
$tagsection = get_the_tags();
@scottnix
scottnix / gist:5992758
Created July 14, 2013 00:51
Remove "Posted" from Thematic Comment Meta
<?php
// modifying the comment-meta
// yanked out the translation stuff (for ease of use)
// reference http://thematictheme.com/forums/topic/customize-how-comments-appear/
function childtheme_override_commentmeta($print = TRUE) {
$content = '<div class="comment-meta">';
$content .= '<a href="' . get_permalink() . '#comment-' . get_comment_ID() . '" title="Link to comment">';
$content .= get_comment_date() . ' at ' . get_comment_time();