This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// updated working version, adds menu description in span tags | |
// reference: http://forums.themeshaper.com/topic/thematic-menus-demystified-1 | |
class Custom_Walker extends Walker_Nav_Menu { | |
function start_el(&$output, $item, $depth, $args) { | |
global $wp_query; | |
$indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; | |
$class_names = $value = ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// make whole post clickable on the index page by adding JavaScript to only that category | |
// also add a cursor: pointer; in CSS to the div/category | |
// reference: http://thematictheme.com/forums/topic/wrap-entry-content-in-anchor-tags/ | |
function childtheme_override_index_loop() { | |
// Count the number of posts so we can insert a widgetized area | |
$count = 1; | |
while ( have_posts() ) : the_post(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function snix_clean_shortcodes($content) { | |
$array = array ( | |
'<p>[' => '[', | |
']</p>' => ']', | |
']<br />' => ']' | |
); | |
$content = strtr($content, $array); | |
return $content; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// example of using ACF custom fields, with conditionals | |
// this has to be set inside the loop, not sure how to place one anywhere yet (haven't needed it) | |
function childtheme_acf_additions() { | |
if (is_single()) { ?> | |
<ul class="toggle-specs c-engine"> | |
<h3 class="expand">Engine Specs <i class="">+</i></h3> | |
<div class="panel"> | |
<?php | |
if(get_field('c_engine')) { | |
echo '<li><span>Engine:</span> ' . get_field('c_engine') . '</li>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* css */ | |
.slider { | |
margin: 1.625em 0; | |
} | |
.slider ul { | |
margin: 0; | |
padding: 0; | |
} | |
@media (min-width: 680px) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// reference http://thematictheme.com/forums/topic/making-minor-amendments-to-templates/ | |
// reference override example (same thing, different way to do it). I prefer the filter. https://gist.github.com/scottnix/5790774 | |
// remove the author information from all posts using a filter | |
function childtheme_postheader_postmeta($postmeta) { | |
$postmeta = "\n\t\t\t\t\t"; | |
$postmeta .= '<div class="entry-meta">' . "\n\n"; | |
$postmeta .= "\t" . thematic_postmeta_entrydate() . "\n\n"; | |
$postmeta .= "\t" . thematic_postmeta_editlink() . "\n\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// reference http://thematictheme.com/forums/topic/making-minor-amendments-to-templates/ | |
// reference filter example (same thing, different way to do it). I prefer the filter. https://gist.github.com/scottnix/5790774 | |
// remove the author information from all posts using the child theme override functionality | |
function childtheme_override_postheader_postmeta() { | |
$postmeta = "\n\t\t\t\t\t"; | |
$postmeta .= '<div class="entry-meta">' . "\n\n"; | |
$postmeta .= "\t" . thematic_postmeta_entrydate() . "\n\n"; | |
$postmeta .= "\t" . thematic_postmeta_editlink() . "\n\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// reference - http://thematictheme.com/forums/topic/returntrue-nivo-slider-example-using-the-same-pattern-but-with-anythingslider/ | |
function wicked_slider_frontpage() { | |
if (is_front_page()) { ?> | |
<ul class="slider theme-default"> | |
<?php | |
$tmp = $wp_query; | |
$wp_query = new WP_Query('posts_per_page=5&category_name=featured'); | |
if($wp_query->have_posts()) { | |
while($wp_query->have_posts()) : | |
$wp_query->the_post(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// remove the deprecated options from the Page Template menu in WordPress Admin | |
// this removes them in both sections, the main edit screen and the quick edit opion using jQuery | |
// http://wordpress.stackexchange.com/questions/13671/how-to-remove-a-parent-theme-page-template-from-a-child-theme | |
function wpse_13671_script_enqueuer() { | |
global $current_screen; | |
/** | |
* /wp-admin/edit.php?post_type=page | |
*/ | |
if('edit-page' == $current_screen->id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// override the category loop | |
// http://thematictheme.com/forums/topic/post-listing-without-thumbnails/ | |
function childtheme_override_category_loop() { | |
if ( is_category('blog') ) { | |
while ( have_posts() ) : the_post(); | |
// your custom blog loop | |
// reference thematic/library/extensions/content-extensions.php where the original loop resides. | |
endwhile; |