Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *
- * Display an tour using
- * Genesis column classes and ACF.
- *
- * @author Angie Meeker
- * @uses Advanced Custom Fields
- */
- add_action( 'genesis_post_content', 'theme_prefix_tour', 12 );
- function theme_prefix_tour() {
- if ( !is_single() )
- return;
- // Store the tour data
- $tour_data = array(
- 'contact' => get_field('contact'),
- 'admission' => get_field('admission'),
- 'hours' => get_field('hours'),
- 'coaches_accepted' => get_field('coaches_accepted'),
- 'reservations_required' => get_field('reservations_required'),
- 'length_of_tour' => get_field('length_of_tour'),
- 'location_of_parking' => get_field('location_of_parking'),
- 'comp_policy' => get_field('comp_policy'),
- 'restrooms_available' => get_field('restrooms_available'),
- 'dietary_menu_available' => get_field('dietary_menu_available'),
- );
- if ($tour_data['contact'] != '' ||
- $tour_data['admission'] != '' ||
- $tour_data['hours'] != '' ||
- $tour_data['coaches_accepted'] != '' ||
- $tour_data['reservations_required'] != '' ||
- $tour_data['length_of_tour'] != '' ||
- $tour_data['location_of_parking'] != '' ||
- $tour_data['comp_policy'] != '' ||
- $tour_data['restrooms_available'] != '' ||
- $tour_data['dietary_menu_available'] != '') {
- echo '<div class="details">Tour Information</div>';
- echo '<div class="location-wrap one-half first">';
- if ( $tour_data['contact'] ) {
- echo '<div class="location">' . esc_attr( $tour_data['contact'] ) . '</div>';
- }
- if ( $tour_data['admission'] ) {
- echo '<div class="location">' . esc_attr( $tour_data['admission'] ) . '</div>';
- }
- if ( $tour_data['hours'] ) {
- echo '<div class="location">' . esc_attr( $tour_data['hours'] ) . '</div>';
- }
- if ( $tour_data['coaches_accepted'] ) {
- echo '<div class="location">' . esc_attr( $tour_data['coaches_accepted'] ) . '</div>';
- }
- if ( $tour_data['reservations_required'] ) {
- echo '<div class="location">' . esc_attr( $tour_data['reservations_required'] ) . '</div>';
- }
- if ( $tour_data['length_of_tour'] ) {
- echo '<div class="location">' . esc_attr( $tour_data['length_of_tour'] ) . '</div>';
- }
- if ( $tour_data['location_of_parking'] ) {
- echo '<div class="location">' . esc_attr( $tour_data['location_of_parking'] ) . '</div>';
- }
- if ( $tour_data['comp_policy'] ) {
- echo '<div class="location">' . esc_attr( $tour_data['comp_policy'] ) . '</div>';
- }
- if ( $tour_data['restrooms_available'] ) {
- echo '<div class="location">' . esc_attr( $tour_data['restrooms_available'] ) . '</div>';
- }
- if ( $tour_data['dietary_menu_available'] ) {
- echo '<div class="location">' . esc_attr( $tour_data['dietary_menu_available'] ) . '</div>';
- }
- echo '</div>';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment