Apologies – I’m using the ‘Driftwood’ theme by Nudge Media Design.
This is the full index.php
<?php get_header(); ?>
<div class="container">
<?php if(get_theme_mod( 'nmd_featured_slider' ) == true) : ?>
<?php get_template_part('inc/featured/featured'); ?>
<?php endif; ?>
<div class="beforecontent-container">
<?php if(is_front_page()) : ?>
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Before Content Widget") ) : ?><?php endif; ?>
<?php endif; ?>
</div>
<div id="content">
<div id="main" <?php if(get_theme_mod('nmd_sidebar_homepage') == true) : ?>class="fullwidth"<?php endif; ?>>
<?php if(get_theme_mod('nmd_home_layout') == 'grid' || get_theme_mod('nmd_home_layout') == 'full_grid') : ?><ul class="nmd-grid"><?php endif; ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php if(get_theme_mod('nmd_home_layout') == 'grid') : ?>
<?php get_template_part('content', 'grid'); ?>
<?php elseif(get_theme_mod('nmd_home_layout') == 'list') : ?>
<?php get_template_part('content', 'list'); ?>
<?php elseif(get_theme_mod('nmd_home_layout') == 'full_list') : ?>
<?php if( $wp_query->current_post == 0 && !is_paged() ) : ?>
<?php get_template_part('content'); ?>
<div class="bannerad-container">
<?php if(is_front_page()) : ?>
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Banner Ad Widget") ) : ?><?php endif; ?>
<?php endif; ?>
</div>
<?php else : ?>
<?php get_template_part('content', 'list'); ?>
<?php endif; ?>
<?php elseif(get_theme_mod('nmd_home_layout') == 'full_grid') : ?>
<?php if( $wp_query->current_post == 0 && !is_paged() ) : ?>
<?php get_template_part('content'); ?>
<div class="bannerad-widget-container">
<div class="bannerad-widget">
<?php if(is_front_page()) : ?>
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Banner Ad Widget") ) : ?><?php endif; ?>
<?php endif; ?>
</div>
</div>
<?php else : ?>
<?php get_template_part('content', 'grid'); ?>
<?php endif; ?>
<?php else : ?>
<?php get_template_part('content'); ?>
<?php endif; ?>
<?php endwhile; ?>
<?php if(get_theme_mod('nmd_home_layout') == 'grid' || get_theme_mod('nmd_home_layout') == 'full_grid') : ?></ul><?php endif; ?>
<?php nudgemedia_pagination(); ?>
<?php endif; ?>
</div>
<?php if(get_theme_mod('nmd_sidebar_homepage')) : else : ?><?php get_sidebar(); ?><?php endif; ?>
<?php get_footer(); ?>