Skip to content

Instantly share code, notes, and snippets.

@Dirtyern12
Created January 12, 2015 18:04
Show Gist options
  • Save Dirtyern12/c946ec7250228b18c1ce to your computer and use it in GitHub Desktop.
Save Dirtyern12/c946ec7250228b18c1ce to your computer and use it in GitHub Desktop.
project.php
<?php
/**
* Archive Page Template for project CPT
*
* @package D2C_JetFab
* @author Travis Smith <[email protected]>
* @copyright Copyright (c) 2014, Travis Smith
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 1.0.0
*/
add_action( 'body_class', 'wps_archive_project_body_class' );
/**
* Adds genesis as post class
*
* @param array $classes Classes array
* @return array $classes Classes array
*/
function wps_archive_project_body_class( $classes ) {
$classes[] = 'project-template';
return $classes;
}
remove_action( 'genesis_entry_content', 'genesis_do_post_content' );
add_action( 'genesis_entry_content', 'wps_do_project_content' );
/**
* Outputs specially formatted content, based on the grid loop args.
*
*/
function wps_do_project_content() {
}
add_action( 'genesis_entry_content', 'wps_do_project_details', 15 );
function wps_do_project_details() {
echo '<div class="details">';
printf( '<p class="infostuff">%s</p>', get_post_meta( get_the_ID(), '_d2c_projectdescription', true ) );
echo'</div>';
echo '<br>';
echo '<div class="sliderimages">';
echo do_shortcode( genesis_get_custom_field( '_d2c_projectimages' ) );
echo'</div>';
echo '<h2 class="testimon">Testimonial:</h2>';
printf( '<p class="testimon">%s</p>',
get_post_meta( get_the_ID(), '_d2c_testimonial', true ) );
printf( '<p class="homeown">-%s</p>', get_post_meta( get_the_ID(), '_d2c_homeowner', true ) );
echo'</div>';echo'</div>';
}
// Remove Post Info
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
genesis();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment