• 1.
    <?php
  • 2.
    $onepress_service_id       = get_theme_mod( 'onepress_service_id', esc_html__('services', 'onepress') );
  • 3.
    $onepress_service_disable  = get_theme_mod( 'onepress_service_disable' ) == 1 ? true : false;
  • 4.
    $onepress_service_title    = get_theme_mod( 'onepress_service_title', esc_html__('Our Services', 'onepress' ));
  • 5.
    $onepress_service_subtitle = get_theme_mod( 'onepress_service_subtitle', esc_html__('Section subtitle', 'onepress' ));
  • 6.
    // Get data
  • 7.
    $page_ids =  onepress_get_section_services_data();
  • 8.
    if ( ! empty( $page_ids ) ) {
  • 9.
        ?>
  • 10.
        <?php if (!$onepress_service_disable) : ?>
  • 11.
            <section id="<?php if ($onepress_service_id != '') echo $onepress_service_id; ?>" <?php do_action('onepress_section_atts', 'services'); ?>
  • 12.
                     class="<?php echo esc_attr(apply_filters('onepress_section_class', 'section-services section-padding section-meta onepage-section', 'services')); ?>">
  • 13.
                <?php do_action('onepress_section_before_inner', 'services'); ?>
  • 14.
                <div class="container">
  • 15.
                    <div class="section-title-area">
  • 16.
                        <?php if ($onepress_service_subtitle != '') echo '<h5 class="section-subtitle">' . esc_html($onepress_service_subtitle) . '</h5>'; ?>
  • 17.
                        <?php if ($onepress_service_title != '') echo '<h2 class="section-title">' . esc_html($onepress_service_title) . '</h2>'; ?>
  • 18.
                    </div>
  • 19.
                    <div class="row">
  • 20.
                        <?php
  • 21.
                        if ( ! empty( $page_ids ) ) {
  • 22.
                            global $post;
  • 23.
                            foreach ($page_ids as $settings) {
  • 24.
                                $post_id = $settings['content_page'];
  • 25.
                                $post = get_post($post_id);
  • 26.
                                setup_postdata($post);
  • 27.
                                $settings['icon'] = trim($settings['icon']);
  • 28.
                                if ($settings['icon'] != '' && strpos($settings['icon'], 'fa-') !== 0) {
  • 29.
                                    $settings['icon'] = 'fa-' . $settings['icon'];
  • 30.
                                }
  • 31.
                                ?>
  • 32.
                                <div class="col-sm-6 wow slideInUp">
  • 33.
                                    <div class="service-item ">
  • 34.
                                        <?php
  • 35.
                                        if ( ! empty( $settings['enable_link'] ) ) {
  • 36.
                                            ?>
  • 37.
                                            <a class="service-link" href="<?php the_permalink(); ?>"><span class="screen-reader-text"><?php the_title(); ?></span></a>
  • 38.
                                            <?php
  • 39.
                                        }
  • 40.
                                        ?>
  • 41.
                                        <?php if ( has_post_thumbnail() ) { ?>
  • 42.
                                            <div class="service-thumbnail ">
  • 43.
                                                <?php
  • 44.
                                                the_post_thumbnail('onepress-medium');
  • 45.
                                                ?>
  • 46.
                                            </div>
  • 47.
                                        <?php } ?>
  • 48.
                                        <?php if ( $settings['icon'] != '' ) { ?>
  • 49.
                                            <div class="service-image">
  • 50.
                                                <i class="fa <?php echo esc_attr($settings['icon']); ?> fa-5x"></i>
  • 51.
                                            </div>
  • 52.
                                        <?php } ?>
  • 53.
                                        <div class="service-content">
  • 54.
                                            <h4 class="service-title"><?php the_title(); ?></h4>
  • 55.
                                            <?php the_content(); ?>
  • 56.
                                        </div>
  • 57.
                                    </div>
  • 58.
                                </div>
  • 59.
                                <?php
  • 60.
                            }
  • 61.
                            wp_reset_postdata();
  • 62.
                        }
  • 63.
     
  • 64.
                        ?>
  • 65.
                    </div>
  • 66.
                </div>
  • 67.
                <?php do_action('onepress_section_after_inner', 'services'); ?>
  • 68.
            </section>
  • 69.
        <?php endif;
  • 70.
    }
  • 71.
     
<?php $onepress_service_id = get_theme_mod( 'onepress_service_id', esc_html__('services', 'onepress') ); $onepress_service_disable = get_theme_mod( 'onepress_service_disable' ) == 1 ? true : false; $onepress_service_title = get_theme_mod( 'onepress_service_title', esc_html__('Our Services', 'onepress' )); $onepress_service_subtitle = get_theme_mod( 'onepress_service_subtitle', esc_html__('Section subtitle', 'onepress' )); // Get data $page_ids = onepress_get_section_services_data(); if ( ! empty( $page_ids ) ) { ?> <?php if (!$onepress_service_disable) : ?> <section id="<?php if ($onepress_service_id != '') echo $onepress_service_id; ?>" <?php do_action('onepress_section_atts', 'services'); ?> class="<?php echo esc_attr(apply_filters('onepress_section_class', 'section-services section-padding section-meta onepage-section', 'services')); ?>"> <?php do_action('onepress_section_before_inner', 'services'); ?> <div class="container"> <div class="section-title-area"> <?php if ($onepress_service_subtitle != '') echo '<h5 class="section-subtitle">' . esc_html($onepress_service_subtitle) . '</h5>'; ?> <?php if ($onepress_service_title != '') echo '<h2 class="section-title">' . esc_html($onepress_service_title) . '</h2>'; ?> </div> <div class="row"> <?php if ( ! empty( $page_ids ) ) { global $post; foreach ($page_ids as $settings) { $post_id = $settings['content_page']; $post = get_post($post_id); setup_postdata($post); $settings['icon'] = trim($settings['icon']); if ($settings['icon'] != '' && strpos($settings['icon'], 'fa-') !== 0) { $settings['icon'] = 'fa-' . $settings['icon']; } ?> <div class="col-sm-6 wow slideInUp"> <div class="service-item "> <?php if ( ! empty( $settings['enable_link'] ) ) { ?> <a class="service-link" href="<?php the_permalink(); ?>"><span class="screen-reader-text"><?php the_title(); ?></span></a> <?php } ?> <?php if ( has_post_thumbnail() ) { ?> <div class="service-thumbnail "> <?php the_post_thumbnail('onepress-medium'); ?> </div> <?php } ?> <?php if ( $settings['icon'] != '' ) { ?> <div class="service-image"> <i class="fa <?php echo esc_attr($settings['icon']); ?> fa-5x"></i> </div> <?php } ?> <div class="service-content"> <h4 class="service-title"><?php the_title(); ?></h4> <?php the_content(); ?> </div> </div> </div> <?php } wp_reset_postdata(); } ?> </div> </div> <?php do_action('onepress_section_after_inner', 'services'); ?> </section> <?php endif; }

Copy Code to Clipboard Raw

Sign-in or Create a Free Account.

Snippi uses Twitter or Facebook to register and create accounts. Registration will enable you to keep track of your snippets. We never spam your timeline or wall. Ever.

Sign-in with Facebook Sign-in with Twitter