Skip to content

Instantly share code, notes, and snippets.

@cdils
Last active January 31, 2016 18:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdils/61b8a0720fe828acb467 to your computer and use it in GitHub Desktop.
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/
<?
/**
* 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();
<?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