HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ns3133907 6.8.0-86-generic #87-Ubuntu SMP PREEMPT_DYNAMIC Mon Sep 22 18:03:36 UTC 2025 x86_64
User: cssnetorguk (1024)
PHP: 8.2.28
Disabled: NONE
Upload Files
File: //home/dorsetandsomersetairambulance.org.uk/public_html/wp-content/themes/dw-focus/index.php
<?php
/**
 * The main template file
 *
 * @package DW Focus
 * @since DW Focus 1.2.6
 */

get_header(); ?>
<div class="container">
	<div class="content-inner">
		<div class="row">
			<div class="<?php dw_focus_primary_column_class(); ?>">
				<div id="primary" class="content-area">
					<main id="main" class="site-main" role="main">
					<?php
					$front_page = dw_focus_get_theme_option( 'dw_front_page' );
					if ( ! $front_page ) {
						$front_page = 'home_sidebar';
					}
					$layout = 'list';
					$col = 12;
					?>
					<?php if ( is_home() && is_active_sidebar( 'dw_focus_home' ) && $front_page == 'home_sidebar' ) : ?>
						<?php dynamic_sidebar( 'dw_focus_home' ); ?>
					<?php else : ?>

						<?php if ( is_active_sidebar( 'dw_focus_top_category' ) ) : ?>
                <?php dynamic_sidebar( 'dw_focus_top_category' ); ?>
						<?php endif; ?>

						<?php if ( is_archive() ) : ?>
						<header class="page-header">
							<?php the_archive_title( '<h1 class="page-title category-header">', '</h1>' ); ?>
							<?php
							if ( isset( $_COOKIE['cat_listing'] ) ) {
								$layout = esc_attr( $_COOKIE['cat_listing'] );
							} else {
								if ( ! ( dw_focus_get_theme_option( 'dw_category_layout' ) ) ) {
									$layout = 'list';
								} else {
									$layout = dw_focus_get_theme_option( 'dw_category_layout' );
								}
							}
							if ( 'list' == $layout ) {
								$col = 12;
							} else {
								$col = 4;
							}
							?>
							<div class="layout-select pull-right">
								<a class="layout-list <?php dw_focus_active( apply_filters( 'cat_display_filter', $layout ), 'list' ); ?>" href="#"><i class="fa fa-th-list"></i></a>
								<a class="layout-grid <?php dw_focus_active( apply_filters( 'cat_display_filter', $layout ), 'grid' ); ?>" href="#"><i class="fa fa-th"></i></a>
							</div>
							<?php the_archive_description( '<div class="taxonomy-description">', '</div>' ); ?>
						</header>
						<?php elseif ( is_search() ) : ?>
						<header class="page-header">
							<h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'dw-focus' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
						</header>
						<?php endif; ?>
						<?php if ( have_posts() ) : ?>
						<div class="posts-inner layout-<?php echo esc_attr( dw_focus_cat_filter( dw_focus_get_theme_option( 'dw_category_layout' ) ) ); ?>">
							<div class="row">
							<?php $item_count = $wp_query->post_count; ?>
							<?php
							$i = 1;
							while ( have_posts() ) : the_post();
							?>
								<div class="col-md-<?php echo esc_attr( $col );?>">
									<?php get_template_part( 'content', get_post_format() ); ?>
								</div>
							<?php if ( ( 0 === $i % ( 3 ) ) && ( $i < $item_count ) ) : ?>
							</div><div class="row">
							<?php endif; ?>
							<?php
							$i++;
							endwhile;
							?>
							</div>
						</div>
							<?php dw_focus_post_navigation(); ?>
						<?php else : ?>
							<?php get_template_part( 'content', 'none' ); ?>
						<?php endif; ?>
					<?php endif; ?>
					</main>
				</div>
			</div>
			<div class="<?php dw_focus_secondary_column_class(); ?>">
				<?php get_sidebar(); ?>
			</div>
		</div>
	</div>
</div>
<?php
if ( is_home() ) {
	get_sidebar( 'bottom' );
}
?>
<?php get_footer(); ?>