This file contains hidden or 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
public function action_init_theme() { | |
parent::action_init_theme(); | |
Format::apply( 'format_date', 'post_pubdate_out', '<span class="post-day">{j}</span><span class="post-month">{F}</span>'); | |
} |
This file contains hidden or 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 kkf_home_sidebar() { | |
if ( is_home()) { | |
remove_action( 'genesis_after_content', 'genesis_get_sidebar' ); | |
add_action( 'genesis_after_content', 'kkf_get_home_sidebar' ); | |
} | |
} | |
function kkf_get_home_sidebar() { | |
get_sidebar( 'news' ); | |
} |
This file contains hidden or 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 kkf_get_images($overrides = '', $exclude_thumbnail = false) | |
{ | |
return get_posts(wp_parse_args($overrides, array( | |
'numberposts' => -1, | |
'post_parent' => get_the_ID(), | |
'post_type' => 'attachment', | |
'post_mime_type' => 'image', | |
'order' => 'ASC', | |
'exclude' => $exclude_thumbnail ? array(get_post_thumbnail_id()) : array(), | |
'orderby' => 'menu_order ID' |
This file contains hidden or 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_action( 'genesis_post_content' , 'genesis_do_post_content' ); | |
add_action( 'genesis_post_content' , 'kkf_do_custom_post_content' ); | |
remove_action( 'genesis_before_post_content', 'genesis_post_info' ); | |
remove_action( 'genesis_after_post_content', 'genesis_post_meta' ); | |
function kkf_do_custom_post_content() { ?> | |
<?php $photos = kkf_get_images('posts_per_page=12', true); ?> | |
<?php if ( $photos ) { ?> | |
<ul class="newsletter-gallery"> | |
<?php foreach ($photos as $photo) { |
This file contains hidden or 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 | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query | |
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php | |
*/ | |
$args = array( |
This file contains hidden or 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
/** | |
* add custom "mime types" (file supertypes) | |
* @param array $post_mime_types | |
* @return array | |
*/ | |
function filterPostMimeTypes($post_mime_types) { | |
$post_mime_types['application/pdf'] = array('PDF', 'Manage PDFs', _n_noop('PDF <span class="count">(%s)</span>', 'PDFs <span class="count">(%s)</span>')); | |
$post_mime_types['application/msword'] = array('Word Docs', 'Manage Word Docs', _n_noop('Word DOC <span class="count">(%s)</span>', 'Word Docs <span class="count">(%s)</span>')); | |
return $post_mime_types; | |
} |
This file contains hidden or 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
add_action('wp_head', 'kkf_add_autosuggest'); | |
function kkf_add_autosuggest() { | |
?> | |
<script type="text/javascript"> | |
// Function to add tag auto suggest | |
function setSuggest(id) { | |
jQuery('#' + id).suggest("<?php echo admin_url('/admin-ajax.php?action=ajax-tag-search&tax=search_term'); ?>", { delay: 500, minchars: 2 }); | |
} | |
</script> |
This file contains hidden or 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
/*If only one search result match, redirect to that page */ | |
function kkf_singlesearch_redirect() { | |
if (is_search()) { | |
global $wp_query; | |
if ($wp_query->post_count == 1) { | |
wp_redirect( get_permalink( $wp_query->posts['0']->ID ) ); | |
} | |
} | |
} |
This file contains hidden or 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
// change excerpt ellipse to link to full post | |
function excerpt_ellipse($text) { | |
return str_replace('[...]', ' … <a href="'.get_permalink().'">Continue reading ' .get_the_title(). '</a>', $text); | |
return strip_tags($text, '<p>'); | |
} | |
add_filter('excerpt_more', 'excerpt_ellipse'); |
This file contains hidden or 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
/** | |
* Proof of Concept for "fancy" call to action | |
*/ | |
body {background: #fff;} | |
@-webkit-keyframes rotate { | |
0% { -webkit-transform: rotate(0deg) } | |
100% { -webkit-transform: rotate(360deg) }} |
OlderNewer