| Server IP : 35.154.56.2 / Your IP : 216.73.217.116 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ip-172-31-0-189 6.8.0-1029-aws #31-Ubuntu SMP Wed Apr 23 18:20:04 UTC 2025 aarch64 User : ubuntu ( 1000) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /srv/prima-automation.com/html/wp-content/themes/bapl/ |
Upload File : |
<?php
/**
* The template for displaying archive pages
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage BAPL
* @since 1.0
* @version 1.0
*/
get_header('inner');
$serviceSlug = get_query_var('service');
$serviceData = get_term_by( 'slug', $serviceSlug, 'service' );
$taxonomyService = get_terms(array('taxonomy' => 'service', 'hide_empty' => false, 'posts_per_page' => -1));
if($serviceSlug) :
$termFields = pods('service', $serviceSlug);
$termImg = $termFields->field('taxonomy-service-image');
$termBackgroundImg = $termFields->field('taxonomy-service-featured-image');
$termDescription = $termFields->field('taxonomy-service-description');
?>
<div class="header-wrapper">
<div class="header-bg" style="background-image: url('<?php echo $termBackgroundImg['guid']; ?>');"></div>
<div class="overlay"></div>
<div class="container">
<div class="row">
<div class="col-xs-12 col-lg-12 col-md-12">
<h1 class="page-title"><?php echo $serviceData->name; ?></h1>
</div>
</div>
</div>
</div>
<?php if(function_exists('bcn_display')) { ?>
<div class="breadcrumbs-wrapper">
<div class="container">
<ol class="breadcrumb">
<?php bcn_display(); ?>
</ol>
</div>
</div>
<?php } ?>
<div class="container">
<div class="row">
<div class="col-lg-9 col-md-9 col-sm-9 col-sm-push-3 col-md-push-3 col-lg-push-3">
<div class="entry-content">
<?php echo $termDescription; ?>
</div>
</div>
<?php if(is_array($taxonomyService) && count($taxonomyService)) : ?>
<div class="col-lg-3 col-md-3 col-sm-3 col-sm-pull-9 col-md-pull-9 col-lg-pull-9 sidebar">
<!-- Sidebar content begins -->
<div id="secondary">
<div class="advanced-sidebar-menu">
<h4><span>Browse</span></h4>
<ul>
<?php echo getLeftMenu(0); ?>
<li><a href="http://www.primatransformer.com/" target="_blank">Transformers</a></li>
</ul>
</div>
<a href="<?php echo get_permalink(360); ?>" class="btn btn-download"><img src="<?php echo get_template_directory_uri(); ?>/assets/images/download-brochure-icon.png" alt=""> Download Brochures</a>
<a class="btn btn-download"><img src="<?php echo get_template_directory_uri(); ?>/assets/images/testimonial-icon.png" alt=""> View our Testimonials</a>
</div>
<!-- Sidebar content ends -->
</div>
<?php endif; ?>
</div>
</div>
<?php
endif;
get_footer();
function getLeftMenu($parentID, $level=0, $flag=0) {
global $taxonomyService;
if($flag == 0) $string = '<ul>';
foreach($taxonomyService as $service) {
$children = get_terms( $service->taxonomy, array( 'parent' => $service->term_id, 'hide_empty' => false ) );
if($service->parent == $parentID) :
$string .= '<li class="' . ($level == 0 ? 'submenu-one ' : ($level == 1 ? 'submenu-two ' : '')) . $service->slug . '"><a href="' . get_category_link($service->term_id) . '"><span onclick="window.open(\''. get_category_link($service->term_id) .'\', \'_self\')">' . $service->name . '</span></a>';
if($service->count > 0) {
$string .= '<ul>'; $string .= getServices($service->slug);
if($children > 0) $string .= getLeftMenu($service->term_id, $level+1, 1);
} else {
if($children > 0) $string .= getLeftMenu($service->term_id, $level+1, 0);
}
$string .= '</li>';
endif;
}
return $string . ($level != 0 ? '</ul>' : '');
}
function getServices($serviceSlug) {
$args = array('post_type' => 'services', 'tax_query' => array( array( 'taxonomy' => 'service', 'field' => 'slug', 'include_children' => false, 'terms' => array($serviceSlug) ) ), 'post_status' => 'publish', 'posts_per_page' => -1);
$servicesQuery = new WP_Query($args);
if ($servicesQuery->have_posts()) :
while ($servicesQuery->have_posts()) : $servicesQuery->the_post();
$string .= '<li><a href="' . get_the_permalink() . '">' . get_the_title() . '</a></li>';
endwhile;
endif;
return $string;
}
?>