/home/awneajlw/www/decenttraders.online/wp-content/themes/diziti/single-service.php
<?php get_header();
$data = \DIZITI\Includes\Classes\Common::instance()->data('single-service')->get();
$layout = $data->get('layout');
$sidebar = $data->get('sidebar');
$layout = ($layout) ? $layout : 'right';
$sidebar = ($sidebar) ? $sidebar : 'default-sidebar';
if (is_active_sidebar($sidebar)) {
$layout = 'right';
} else {
$layout = 'full';
}
$class = (!$layout || $layout == 'full') ? 'col-xl-12 col-lg-12' : 'col-12 col-lg-8';
$options = diziti_WSH()->option();
do_action('diziti_banner', $data);
$allowed_tags = wp_kses_allowed_html('post');
?>
<!--Start Solution Detail Page -->
<section class="service-details-section fix section-padding">
<div class="container">
<div class="service-details-wrapper style1">
<div class="row g-4">
<?php if( $data->get( 'layout' ) == 'left' ): ?>
<!--Start Sidebar-->
<div class="col-12 col-lg-4 <?php if ( $data->get( 'layout' ) == 'left' ) echo 'left-sidebar'; elseif ( $data->get( 'layout' ) == 'right' ) echo 'right-sidebar'; ?>">
<div class="main-sidebar">
<?php dynamic_sidebar( $sidebar ); ?>
</div>
</div>
<?php endif; ?>
<?php
while (have_posts()) : the_post();
?>
<div class="<?php echo esc_attr( $class ); ?> content-side">
<div class="service-details-items">
<?php if(has_post_thumbnail()){ ?>
<div class="details-image img-custom-anim-left">
<?php the_post_thumbnail('full'); ?>
</div>
<?php } ?>
<div class="details-content">
<h3 class="wow fadeInUp" data-wow-delay=".6s"><?php the_title(); ?></h3>
<?php the_content(); ?>
<?php
$icons = get_post_meta(get_the_id(), 'highlights_tabs', true); if ($icons) :
?>
<div class="card-area mt-30">
<div class="row g-4">
<?php
for ( $i=0; $i < count( $icons['highlight_title'] ); $i++ ) {
$highlight_title = ( isset( $icons['highlight_title'][$i] ) && !empty( $icons['highlight_title'][$i] ) ) ? $icons['highlight_title'][$i] : '';
$highlight_btn_title = ( isset( $icons['highlight_btn_title'][$i] ) && !empty( $icons['highlight_btn_title'][$i] ) ) ? $icons['highlight_btn_title'][$i] : '';
$highlight_btn_link = ( isset( $icons['highlight_btn_link'][$i] ) && !empty( $icons['highlight_btn_link'][$i] ) ) ? $icons['highlight_btn_link'][$i] : '';
$highlight_icon_image = ( isset( $icons['highlight_icon_image'][$i] ) && !empty( $icons['highlight_icon_image'][$i] ) ) ? $icons['highlight_icon_image'][$i] : '';
?>
<div class="col-md-6">
<div class="service-card style4 wow fadeInUp" data-wow-delay=".3s">
<div class="img-area mb-20">
<div class="wcu-icon"><img
src="<?php echo wp_get_attachment_url($highlight_icon_image['id']);?>" alt="<?php bloginfo( 'name' ); ?>">
</div>
</div>
<div class="card-content">
<h6 class="text mb-3"><?php echo wp_kses($highlight_title, true); ?></h6>
<div class="btn-wrapper">
<a href="<?php echo esc_url($highlight_btn_link, true); ?>" class="ct-btn style4"><?php echo wp_kses($highlight_btn_title, true); ?><i
class="fa-regular fa-arrow-right-long"></i></a>
</div>
</div>
</div>
</div>
<?php } ?>
</div>
</div>
<?php endif; ?>
</div>
</div>
<?php
$icons = get_post_meta(get_the_id(), 'advantages_tabs', true); if ($icons) :
?>
<div class="row">
<div class="col-12 col-lg-9">
<?php if(get_post_meta( get_the_id(), 'advantage_title', true)); { ?>
<div class="faq-title mt-60">
<h4 class="wow fadeInUp" data-wow-delay=".6s"><?php echo (get_post_meta( get_the_id(), 'advantage_title', true ));?></h4>
</div>
<?php } ?>
<div class="faq-content style-3 mt-30">
<div class="accordion" id="accordionExample">
<?php
$countss = 1; // Initialize counter
for ($i = 0; $i < count($icons['advantages_title']); $i++) {
$advantages_title = (isset($icons['advantages_title'][$i]) && !empty($icons['advantages_title'][$i])) ? $icons['advantages_title'][$i] : '';
$advantages_text = (isset($icons['advantages_text'][$i]) && !empty($icons['advantages_text'][$i])) ? $icons['advantages_text'][$i] : '';
// Generate unique IDs for each accordion item
$collapseId = "collapse" . $countss;
$isActive = ($countss === 1) ? 'show' : ''; // Active class for the first item
$isCollapsed = ($countss === 1) ? '' : 'collapsed'; // Button class for inactive items
?>
<div class="ct-accordion-item style1 mb-20">
<h2 class="ct-accordion-header style1">
<button class="ct-accordion-button <?php echo $isCollapsed; ?>" type="button"
data-bs-toggle="collapse" data-bs-target="#<?php echo $collapseId; ?>"
aria-expanded="<?php echo ($countss === 1) ? 'true' : 'false'; ?>"
aria-controls="<?php echo $collapseId; ?>">
<strong><?php echo wp_kses($advantages_title, true); ?></strong>
<span class="plus"><i class="fa-solid fa-plus"></i></span>
<span class="minus"><i class="fa-solid fa-minus"></i></span>
</button>
</h2>
<div id="<?php echo $collapseId; ?>" class="ct-accordion-collapse collapse <?php echo $isActive; ?>"
data-bs-parent="#accordionExample">
<div class="ct-accordion-body">
<p><?php echo wp_kses($advantages_text, true); ?></p>
</div>
</div>
</div>
<?php
$countss++; // Increment counter
}
?>
</div>
</div>
</div>
</div>
<?php endif; ?>
</div>
<?php endwhile; ?>
<?php if( $data->get( 'layout' ) == 'right' ): ?>
<!--Start Sidebar-->
<div class="col-12 col-lg-4 <?php if ( $data->get( 'layout' ) == 'left' ) echo 'left-sidebar'; elseif ( $data->get( 'layout' ) == 'right' ) echo 'right-sidebar'; ?>">
<div class="main-sidebar">
<?php dynamic_sidebar( $sidebar ); ?>
</div>
</div>
<?php endif; ?>
</div>
</div>
</div>
</section>
<!-- service-details end -->
<?php get_footer(); ?>