Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
/**
* IT informa Responsive child theme of evision themes functions and definitions
*
* @package itinforma-responsive themes
* @subpackage itinforma-responsive / eVision Corporate Pro
*/
function evisioncorporatepro_front_service() {
global $evisioncorporatepro_customizer_all_values;
$evisioncorporatepro_services = coder_get_repeated_all_value('evisioncorporatepro-service');
if( isset( $evisioncorporatepro_customizer_all_values['evisioncorporatepro-service-enable'] ) && 1 == $evisioncorporatepro_customizer_all_values['evisioncorporatepro-service-enable'] ) {
$evisioncorporatepro_service_pages_ids = array();
if( null != $evisioncorporatepro_services ){
foreach($evisioncorporatepro_services as $evisioncorporatepro_service) {
if( 0 != $evisioncorporatepro_service['evisioncorporatepro-service-pages'] ) {
$evisioncorporatepro_service_pages_ids[] = $evisioncorporatepro_service['evisioncorporatepro-service-pages'];
}
}
}
?>
<!-- *****************************************
service section start
****************************************** -->
<section class="wrapper block-service block-section block-bg-image" id="evisioncorporatepro-service">
<div class="block-overlay"> &nbsp; </div>
<div class="block-overlay-content">
<div class="container">
<div class="block-title">
<?php
if(isset($evisioncorporatepro_customizer_all_values['evisioncorporatepro-service-main-title']) && !empty($evisioncorporatepro_customizer_all_values['evisioncorporatepro-service-main-title']) ){
echo '<h2>'.wp_kses_post( $evisioncorporatepro_customizer_all_values['evisioncorporatepro-service-main-title'] ).'</h2>';
echo '<div class="block-title-divider"><span><i class="fa fa-circle"></i></span></div>';
}
if( isset( $evisioncorporatepro_customizer_all_values['evisioncorporatepro-service-main-content'] ) && !empty( $evisioncorporatepro_customizer_all_values['evisioncorporatepro-service-main-content'] )){
echo '<p class="lead">'.wp_kses_post( $evisioncorporatepro_customizer_all_values['evisioncorporatepro-service-main-content'] ).'</p>';
}
?>
</div>
<?php
if( !empty ( $evisioncorporatepro_service_pages_ids ) ) {
$evisioncorporatepro_service_query = new WP_Query(
array(
'post_type' => 'page',
'post__in' => $evisioncorporatepro_service_pages_ids,
'posts_per_page' => 3,
'orderby' => 'post__in'
)
);
?>
<div class="row">
<div class="row-same-height">
<?php
// the query
if ( $evisioncorporatepro_service_query->have_posts() ) :
/*loop*/
$evisioncorporatepro_services_index = 1;
while ( $evisioncorporatepro_service_query->have_posts() ) :
$evisioncorporatepro_service_query->the_post();
?>
<div class="col-xs-12 col-sm-4 col-sm-height">
<div class="single-circle">
<div class="single-circle-icon">
<span>
<a href="<?php the_permalink();?>" >
<?php if( isset( $evisioncorporatepro_services[$evisioncorporatepro_services_index] ) && isset( $evisioncorporatepro_services[$evisioncorporatepro_services_index]['evisioncorporatepro-service-icon'] ) && !empty( $evisioncorporatepro_services[$evisioncorporatepro_services_index]['evisioncorporatepro-service-icon'] ) ){
echo '<i class="fa '.esc_attr($evisioncorporatepro_services[$evisioncorporatepro_services_index]['evisioncorporatepro-service-icon']).' fa-3x"></i></a>';
}
else {
echo '<a href="#"><i class="fa fa-desktop fa-3x"></i></a>';
}
?>
</span>
</div>
<div class="single-circle-inner test">
<h3>
<?php the_title(); ?>
</h3>
<div class="btn-section">
<a href="<?php the_permalink();?>" class="btn-outline">
<?php _e( 'Know', 'evisioncorporatepro' );?>
<i class="fa fa-angle-double-right"></i>
</a>
</div>
</div>
</div>
</div>
<?php
$evisioncorporatepro_services_index ++;
endwhile;?>
<!-- end of the loop -->
<?php wp_reset_postdata(); ?>
<?php else : ?>
<!--Probably this message never display-->
<p><?php _e( 'Please select pages for service', 'evisioncorporatepro' )?></p>
<?php endif;
?>
</div>
</div>
<?php
}
?>
</div>
</div>
</section>
<!-- *****************************************
service section ends
****************************************** -->
<?php
}
}
add_action( 'evisioncorporatepro_action_front_service', 'evisioncorporatepro_front_service', 10 );
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
function theme_enqueue_styles() {
wp_enqueue_style( 'evisioncorporatepro', get_template_directory_uri() . '/style.css' );
}
add_theme_support( 'post-thumbnails' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.