Skip to content

Instantly share code, notes, and snippets.

@Dirtyern12
Created February 19, 2013 01:02
Show Gist options
  • Save Dirtyern12/4982170 to your computer and use it in GitHub Desktop.
Save Dirtyern12/4982170 to your computer and use it in GitHub Desktop.
<?php
// Remove the post info function
remove_action('genesis_before_post_content', 'genesis_post_info');
remove_action('genesis_after_post_content', 'genesis_post_meta');
// Remove post comments
remove_action('genesis_after_post_content', 'genesis_post_comments');
//add meta boxes
add_action( 'genesis_post_content' , 'wps_do_pitbull_sire' );
add_action( 'genesis_post_content' , 'wps_do_pitbull_dam' );
add_action( 'genesis_post_content' , 'wps_do_pitbull_bday' );
add_action( 'genesis_post_content' , 'wps_do_pitbull_bloodline' );
add_action( 'genesis_post_content' , 'wps_do_pitbull_color' );
add_action( 'genesis_post_content' , 'wps_do_pitbull_stud_fee' );
add_action( 'genesis_post_content' , 'wps_do_pitbull_image' );
add_action( 'genesis_post_content' , 'wps_do_pitbull_image_two' );
add_action( 'genesis_post_content' , 'wps_do_pitbull_image_three' );
function wps_do_pitbull_images( $field = '', $attr = array(), $size = 'Pitbull Gender', $echo = false ) {
if ( '' == $field )
return false;
$url = genesis_get_custom_field( $field );
$postid = genesis_get_custom_field( $field . '_id' );
if ( ! $postid )
$postid = url_to_postid( genesis_get_custom_field( $field ) );
$image = wp_get_attachment_image( $postid, $size, false, $attr );
if ( $echo )
echo $image;
else
return $image;
}
// Add Meta and Description to Archive Page
function wps_do_pitbull_sire() {
wps_class_open( 'pitbull_sire' );
global $post;
wps_class_open( 'pitbull_sire' );
echo '<p>Sire&#58;&nbsp;'.get_post_meta( $post->ID, '_d2c_pitbull_sire', true ).'</p>';
wps_div_close();
wps_div_close();
}
function wps_do_pitbull_dam(){
wps_class_open( 'pitbull_dam' );
global $post;
wps_class_open( 'pitbull_dam' );
echo '<p>Dam&#58&nbsp;' .get_post_meta( $post->ID, '_d2c_pitbull_dam', true ).'</p>';
wps_div_close();
wps_div_close();
}
function wps_do_pitbull_bday(){
wps_class_open( 'pitbull_bday' );
global $post;
wps_class_open( 'pitbull_bday' );
echo '<p>Date of Birth&#58&nbsp;' .get_post_meta( $post->ID, '_d2c_pitbull_bday', true ).'</p>';
wps_div_close();
wps_div_close();
}
function wps_do_pitbull_bloodline(){
wps_class_open( 'pitbull_bloodline' );
global $post;
wps_class_open( 'pitbull_bloodline' );
echo '<p>Bloodline&#58&nbsp;' .get_post_meta( $post->ID, '_d2c_pitbull_bloodline', true ).'</p>';
wps_div_close();
wps_div_close();
}
function wps_do_pitbull_color(){
wps_class_open( 'pitbull_color' );
global $post;
wps_class_open( 'pitbull_color' );
echo '<p>Color&#58&nbsp;' .get_post_meta( $post->ID, '_d2c_pitbull_color', true ).'</p>';
wps_div_close();
wps_div_close();
}
function wps_do_pitbull_stud_fee(){
wps_class_open( 'pitbull_stud_fee' );
global $post;
wps_class_open( 'pitbull_stud_fee' );
echo '<p>Stud Fee&#58&nbsp;&#36;' .get_post_meta( $post->ID, '_d2c_pitbull_stud_fee', true ).'</p>';
wps_div_close();
wps_div_close();
}
function wps_do_pitbull_image() {
wps_id_open( 'pitbull_image' );
global $post;
wps_id_open( 'pitbull_image' );
printf(
'<a href="%s" title="%s" class="%s" rel="%s">%s</a>',
wp_get_attachment_url( genesis_get_custom_field( '_d2c_pitbull_image_one' ) ),
the_title_attribute( 'echo=0' ),
$class,
'Pitbull Gender' . $post->ID,
wps_do_pitbull_images( '_d2c_pitbull_image_one', array( 'class' => 'alignleft cboxElement' ) )
);
wps_div_close();
wps_div_close();
}
function wps_do_pitbull_image_two() {
wps_id_open( 'pitbull_image_two' );
global $post;
wps_id_open( 'pitbull_image_two' );
echo '<img src="' . $foobar . '" />';
wps_div_close();
wps_div_close();
}
function wps_do_pitbull_image_three() {
wps_id_open( 'pitbull_image_three' );
global $post;
wps_id_open( 'pitbull_image_three' );
echo '<p>' .get_post_meta( $post->ID, '_d2c_pitbull_image_three', true ).'</p>';
wps_div_close();
wps_div_close();
}
genesis();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment