eventsmanager

Events Manager Genesis Post Meta Removal Snippet

Sep 10th, 2014
321
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /*
  3. This snippet will remove post-specific content from event pages when using Events Manager and Genesis
  4. To use this, simply create a new file and paste the entire contents of this file or add the code below to a present PHP file.
  5. See here for information on where to paste code - http://wp-events-plugin.com/tutorials/how-to-safely-add-php-code-to-wordpress/
  6. */
  7. function em_genesis_single_template($template){
  8.     global $post;
  9.     if( $post->post_type == EM_POST_TYPE_EVENT ){
  10.         $hooks = array(
  11.             'genesis_before_entry',
  12.             'genesis_entry_header',
  13.             'genesis_before_entry_content',
  14.             'genesis_after_entry_content',
  15.             'genesis_entry_footer',
  16.             'genesis_after_entry',
  17.         );
  18.         foreach( $hooks as $hook ){
  19.             remove_all_actions( $hook );
  20.         }
  21.         add_action( 'genesis_entry_header', 'genesis_entry_header_markup_open' , 5 );
  22.         add_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );
  23.         add_action( 'genesis_entry_header', 'genesis_do_post_title' );
  24.     }
  25.     return $template;
  26. }
  27. add_filter('single_template','em_genesis_single_template');
RAW Paste Data