Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //* Offering Subheader -------------------------------------------------------------
- add_action( 'genesis_entry_header', 'olotus_offerings_subhead' );
- function olotus_offerings_subhead() {
- // If the post is a single offering and the subheading custom field exists
- if ( is_single() && 'offerings' == get_post_type() && get_field('olotusoff_subheading') )
- // Display the subheading
- echo
- '<p class="subheading">' . get_field('olotusoff_subheading') . '</p><!-- end subheading -->';
- }
- //* Offering details (yellow box and testimonials) ---------------------------------------------------
- add_action( 'genesis_entry_content', 'olotus_offerings_details' );
- function olotus_offerings_details() {
- // If the post is a single offering and the "details" custom fields exist
- if ( is_single() && 'offerings' == get_post_type() && get_field('olotusoff_details') || get_field('olotusoff_cta') || get_field('olotusoff_notice') || get_field('olotusoff_testimonial') ) {
- // Open markup for details and testimonials
- echo '<section class="dual-box clearfix">';
- // Open markup for details
- echo '<div class="box-first box-small offset-left cta-box">';
- // If details (ACF) are populated
- while( has_sub_field('olotusoff_details') ):
- // Display the details headers and content
- echo '<h3>' . get_sub_field('olotusoff_details_heading') . '</h3>
- <p>' . get_sub_field('olotusoff_details_content') . '</p>';
- endwhile;
- // Display the call to action link and notice
- echo '<a href="' . get_field('olotusoff_ctalink') . '">' . get_field('olotusoff_cta') . '</a>
- <p>' . get_field('olotusoff_notice') . '</p>';
- // Close details markup
- echo '</div>';
- // Open markup for testimonials
- echo '<div class="box-second box-large">';
- // If testimonials (ACF) are populated
- while( has_sub_field('olotusoff_testimonial') ):
- // Display teh testimonials
- echo '<blockquote>
- <p>' . get_sub_field('olotusoff_testimonial_quote') . '</p>
- <cite>' . get_sub_field('olotusoff_testimonial_sourcename') . ', <span>' . get_sub_field('olotusoff_testimonial_sourcelocation') . '</span></cite>
- </blockquote>';
- endwhile;
- // Close testimonials markup
- echo '</div>';
- // Close markup for details and testimonials
- echo '</section>';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement