Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Enqueue Tabslet
- wp_enqueue_script( 'tabslet', get_stylesheet_directory_uri() . '/js/jquery.tabslet.min.js', array( 'jquery' ), '1.4.8', true );
- add_filter( 'genesis_attr_site-inner', 'sk_attributes_site_inner' );
- /**
- * Add attributes for site-inner element.
- *
- * @since 2.0.0
- *
- * @param array $attributes Existing attributes.
- *
- * @return array Amended attributes.
- */
- function sk_attributes_site_inner( $attributes ) {
- $attributes['role'] = 'main';
- $attributes['itemprop'] = 'mainContentOfPage';
- return $attributes;
- }
- // Remove div.site-inner's div.wrap
- add_filter( 'genesis_structural_wrap-site-inner', '__return_empty_string' );
- // Display Header
- get_header();
- // Display Page Content
- genesis_standard_loop();
- // Product Tabs
- // echo 'the value of $tab_section_1_icon is: ' . $tab_section_1_icon;
- $tab_section_1 = get_post_meta( get_the_ID(), 'tab_section_1', true );
- $tab_section_2 = get_post_meta( get_the_ID(), 'tab_section_2', true );
- $tab_section_3 = get_post_meta( get_the_ID(), 'tab_section_3', true );
- $tab_section_4 = get_post_meta( get_the_ID(), 'tab_section_4', true );
- $tab_section_1_content = get_post_meta( get_the_ID(), 'tab_section_1_content', true );
- $tab_section_2_content = get_post_meta( get_the_ID(), 'tab_section_2_content', true );
- $tab_section_3_content = get_post_meta( get_the_ID(), 'tab_section_3_content', true );
- $tab_section_4_content = get_post_meta( get_the_ID(), 'tab_section_4_content', true );
- ?>
- <div class="tabs" data-toggle="tabslet">
- <ul>
- <li><a href="#tab-1" class="icon-itsupportpanel"><?php echo $tab_section_1; ?></a></li>
- <li><a href="#tab-2" class="icon-itnewspanel"><?php echo $tab_section_2; ?></a></li>
- <li><a href="#tab-3" class="icon-itappspanel"><?php echo $tab_section_3; ?></a></li>
- <li><a href="#tab-4" class="pricing-overview"><?php echo $tab_section_4; ?></a></li>
- </ul>
- <div id="tab-1"><?php echo $tab_section_1_content; ?></div>
- <div id="tab-2"><?php echo $tab_section_2_content; ?></div>
- <div id="tab-3"><?php echo $tab_section_3_content; ?></div>
- <div id="tab-4"><?php echo $tab_section_4_content; ?></div>
- </div>
- <?php
- // Displaying icons in tabs
- add_action( 'wp_head', 'sk_tab_icons' );
- function sk_tab_icons() {
- $tab_section_1_icon = get_field( 'tab_section_1_icon' ); ?>
- <style type="text/css">
- .tabs li a.icon-itsupportpanel:before {
- background-image: url( <?php echo $tab_section_1_icon; ?> );
- }
- </style>
- <?php }
- // Product Sections
- echo '<h2 class="wrap">Why invest in ITSupportPanel?</h2>';
- if( have_rows( 'section' ) ) {
- echo '<div class="product-sections clearfix">';
- // loop through the rows of data
- while ( have_rows( 'section' ) ) : the_row();
- $section_h2_heading = get_sub_field( 'section_h2_heading' );
- $section_content = get_sub_field( 'section_content' );
- $section_icon = get_sub_field( 'section_icon' );
- $section_featured_image = get_sub_field( 'section_featured_image' ); ?>
- <div class="product-section"><div class="wrap">
- <div class="two-thirds first">
- <h2 class="section-heading" style="background-image: url(<?php the_sub_field( 'section_icon' ); ?>);"><?php the_sub_field( 'section_h2_heading' ); ?></h2>
- <div class="section-content">
- <?php the_sub_field( 'section_content' ); ?>
- </div>
- </div>
- <div class="one-third">
- <div class="section-featured-image">
- <img src="<?php the_sub_field( 'section_featured_image' ); ?>" />
- </div>
- </div>
- </div></div>
- <?php endwhile;
- echo '</div>';
- }
- else {
- // no product sections found
- }
- genesis_widget_area( 'products-middle', array(
- 'before' => '<div class="products-middle widget-area"><div class="wrap">',
- 'after' => '</div></div>',
- ) );
- // Customer Testimonials
- // WP_Query arguments
- $args = array (
- 'post_type' => 'customers',
- 'posts_per_page' => '3',
- );
- // The Query
- $query = new WP_Query( $args );
- // The Loop
- if ( $query->have_posts() ) {
- echo '<div class="customer-testimonials"><div class="wrap"><h1 class="entry-title" itemprop="headline">Testimonials</h1><div class="clearfix">';
- while ( $query->have_posts() ) {
- $query->the_post();
- // do something
- echo '<div class="customer">';
- // image
- $image = genesis_get_image( 'format=url&size=full' );
- printf( '<div class="customer-logo"><a href="%s" rel="bookmark"><img src="%s" alt="%s" /></a></div>', get_permalink(), $image, the_title_attribute( 'echo=0' ) );
- // excerpt
- echo '<div class="customer-content">';
- the_excerpt();
- echo '</div>';
- // title
- $title = get_the_title() ? get_the_title() : __( '(no title)', 'genesis' );
- printf( '<h2 class="customer-title"><a href="%s">%s</a></h2>', get_permalink(), esc_html( $title ) );
- echo '</div>';
- }
- echo '</div><div class="more-testimonials"><a href="' . trailingslashit( home_url() ) . 'company/customers/ " class="button">View more testimonials</a></div>';
- echo '</div></div>';
- } else {
- // no posts found
- }
- // Restore original Post Data
- wp_reset_postdata();
- // Display Footer
- get_footer();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement