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 | |
/** | |
* Possibly amend the loop. | |
* | |
* Specify the conditions under which the grid loop should be used. | |
* | |
* @author Bill Erickson | |
* @author Gary Jones | |
* @link http://code.garyjones.co.uk/genesis-grid-loop-advanced/ |
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 | |
/** | |
* Template Name: Testimonial Archives | |
* Description: Used as a page template to show page contents, followed by a loop through a CPT archive | |
*/ | |
remove_action ('genesis_loop', 'genesis_do_loop'); // Remove the standard loop | |
add_action( 'genesis_loop', 'custom_do_loop' ); // Add custom loop |
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
add_action( 'genesis_before_content', 'wpsites_before_post_image' ); | |
function wpsites_before_post_image() { | |
if ( !is_page() ) return; | |
if ( $image = genesis_get_image( 'format=url&size=post-image' ) ) { | |
printf( '<a href="%s" rel="bookmark"><img class="post-photo" src="%s" alt="%s" /></a>', get_permalink(), $image, the_title_attribute( 'echo=0' ) ); | |
} | |
} |
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 | |
function get_top_level_parent_title() { | |
global $post; | |
if ( empty($post->post_parent) ) | |
{ the_title(); } | |
else { | |
$ancestors = get_post_ancestors($post->ID); | |
end($ancestors); |
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 | |
/*Add login/logout link to naviagation menu | |
------------------------------------------------------------ */ | |
function add_login_out_item_to_menu( $items, $args ){ | |
//change theme location with your them location name | |
if( is_admin() || $args->theme_location != 'primary' ) | |
return $items; |
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 | |
/* Add Login/out to primary nav | |
------------------------------------------------------------ */ | |
add_filter('wp_nav_menu_items','my_item', 11, 2); | |
function my_item($items, $args) { | |
if( is_admin() || $args->theme_location != 'primary' ) | |
return $items; |
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 | |
/** | |
* Don't show Events category on homepage | |
* Category 5 = Events category, so we use cat=-5 | |
* | |
* @link http://www.billerickson.net/thesis-wordpress-remove-category-homepage/ | |
* @author Bill Erickson | |
* @param object $query | |
*/ |
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 | |
/* Remove the post meta function | |
------------------------------------------------------------ */ | |
remove_action( 'genesis_after_post_content', 'genesis_post_meta' ); |
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 | |
// Enqueue sticky menu script | |
add_action( 'wp_enqueue_scripts', 'custom_enqueue_script' ); | |
function custom_enqueue_script() { | |
wp_enqueue_script( 'sticky-menu', get_stylesheet_directory_uri() . '/js/sticky-menu.js', array( 'jquery' ), '', true ); | |
} | |
// Reposition the secondary navigation menu | |
remove_action( 'genesis_after_header', 'genesis_do_subnav' ); |
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 | |
/* Remove the post info function | |
------------------------------------------------------------ */ | |
remove_action( 'genesis_before_post_content', 'genesis_post_info' ) |