Skip to content

Instantly share code, notes, and snippets.

@Dirtyern12
Created February 12, 2013 23:35
Show Gist options
  • Select an option

  • Save Dirtyern12/4774530 to your computer and use it in GitHub Desktop.

Select an option

Save Dirtyern12/4774530 to your computer and use it in GitHub Desktop.
<?php
add_action( 'genesis_post_content' , 'wps_do_price' );
function wps_do_price() {
wps_class_open( 'price' );
echo '<p>', '&#36;'.__(get_post_meta( $post->ID, '_d2c_price', true ), 'd2c').'</p>';
wps_div_close();
}
genesis();
@GaryJones
Copy link

Remember to call global $post at the start of the function - it's not defined otherwise and you'll either just get a notice, (if WP_DEBUG is on) or nothing appear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment