Last active
January 31, 2016 18:24
-
-
Save cdils/61b8a0720fe828acb467 to your computer and use it in GitHub Desktop.
Here's the Genesis tutorial that references these files: http://www.carriedils.com/remove-links-genesis-custom-archive-page-template/
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
<? | |
/** | |
* Team Archive template | |
*/ | |
// Remove default post title (with link) | |
remove_action( 'genesis_entry_header','genesis_do_post_title' ); | |
add_action( 'genesis_entry_header','cd_archive_title' ); | |
/** | |
* Display the post title (without link). | |
* | |
*/ | |
function cd_archive_title() { | |
echo '<h2 class="title">' . get_the_title() . '</h2> '; | |
} | |
add_action( 'genesis_entry_content', 'cd_archive_featured_image', 8 ); | |
/** | |
* Display featured image (without a link). | |
* | |
* Check to see if the post has a thumbnail and, if so, display the thumbnail. | |
* | |
*/ | |
function cd_archive_featured_image() { | |
if ( ! has_post_thumbnail() ) { | |
return; | |
} | |
$attr = array ( | |
'class' => 'alignleft', | |
'context' => 'archive', | |
'alt' => get_the_title(), | |
); | |
echo '<span class="featured-image">'; | |
the_post_thumbnail( 'thumbnail', $attr ); | |
echo '</span>'; | |
} | |
add_action ( 'genesis_entry_content', 'cd_team_member_details', 9 ); | |
/** | |
* Display team member title and bio. | |
* | |
* Uses WP Types & Views to return two custom fields. | |
* https://wp-types.com/documentation/user-guides/displaying-wordpress-custom-fields/ | |
* | |
*/ | |
function cd_team_member_details() { | |
echo '<strong>' . types_render_field( 'team-member-title', array("output"=>"html") ) . '</strong>'; | |
echo '<p>' . types_render_field( 'bio', array("output"=>"html") ) . '</p>'; | |
} | |
genesis(); |
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_action( 'init', 'team_remove_entry_meta', 12 ); | |
/** | |
* Remove entry meta for the 'team' post type | |
* | |
* @link https://gist.github.com/cdils/61b8a0720fe828acb467/ | |
*/ | |
function team_remove_entry_meta() { | |
remove_post_type_support( 'team', 'genesis-entry-meta-before-content' ); | |
remove_post_type_support( 'team', 'genesis-entry-meta-after-content' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment