`<?php
get_header();
// -> Start Define variables
// theme options variables
$easyweb_webnus_options = easyweb_webnus_options();
$enable_breadcrumbs = isset( $easyweb_webnus_options[‘easyweb_webnus_enable_breadcrumbs’] ) ? $easyweb_webnus_options[‘easyweb_webnus_enable_breadcrumbs’] : ”;
// page options variables
$show_titlebar = rwmb_meta( ‘easyweb_page_title_bar_meta’ );
$titlebar_fg = rwmb_meta( ‘easyweb_page_title_text_color_meta’ );
$titlebar_bg = rwmb_meta( ‘easyweb_page_title_bg_color_meta’ );
$titlebar_fs = rwmb_meta( ‘easyweb_page_title_font_size_meta’ );
$sidebar_pos = rwmb_meta( ‘easyweb_sidebar_position_meta’ );
// others variables
$have_sidebar = $sidebar_pos ? true : false;
// -> End Define variables
// headline and breadcrubs
if ( $show_titlebar ) :
?>
<section id=”headline” style=”<?php if ( ! empty( $titlebar_bg ) ) echo ‘background-color: ‘ . $titlebar_bg . ‘;’; ?>”>
<div class=”container”>
<h2 style=”<?php if ( ! empty( $titlebar_fg ) ) echo ‘color: ‘ . $titlebar_fg . ‘;’; if ( ! empty( $titlebar_fs ) ) echo ‘ font-size: ‘ . $titlebar_fs . ‘;’; ?>”>
<?php the_title(); ?>
</h2>
</div>
</section>
<?php if ( $enable_breadcrumbs == 1 ) { ?>
<div class=”breadcrumbs-w”>
<div class=”container”>
<?php if ( ‘easyweb_webnus_breadcrumbs’ ) easyweb_webnus_breadcrumbs(); ?>
</div>
</div>
<?php };
elseif (is_archive()) : ?>
<section id=”headline”>
<div class=”container”>
<h2>
<?php single_cat_title(); ?>
</h2>
</div>
</section>
<hr class=”vertical-space2″>
<?php
endif;
?>
<!– Start Page Content –>
<section id=”main-content” class=”container”>
<?php if ( ( ‘left’ == $sidebar_pos ) || ( ‘both’ == $sidebar_pos ) ) { ?>
<!– left sidebar –>
<aside class=”col-md-3 sidebar leftside”>
<?php if ( is_active_sidebar( ‘Left Sidebar’ ) ) dynamic_sidebar( ‘Left Sidebar’ ); ?>
</aside>
<?php }
if ( $have_sidebar ) { ?>
<section class=”<?php echo ( $sidebar_pos == ‘both’ ) ? ‘col-md-6 cntt-w’ : ‘col-md-9 cntt-w’; ?>”>
<article>
<?php } ?>
<div class=”row-wrapper-x”>
<?php
if ( is_home() || is_front_page() ) :
while( have_posts() ):
the_post();
the_content();
endwhile;
elseif ( is_archive() ):
$url = ‘https://’ . $_SERVER[‘SERVER_NAME’] . $_SERVER[‘REQUEST_URI’];
if (strpos($url,’/tags/’) !== false) {
echo EM_Events::output(array(‘scope’=>’all’, ‘limit’=>10, ‘pagination’=>1, ‘tag’=>’tagevento1′));
} elseif(strpos($url,’/categorie/’) !== false) {
echo do_shortcode(‘<div class=”contenitore-events”>
[events_list scope=”all” limit=”10″ pagination=”1″ category=”‘.single_cat_title().'”]
<div><a href=”#_EVENTURL”>#_EVENTIMAGE</a></div>
<div>#_EVENTCATEGORIES</div>
<h4 class=”pt-cv-title”>#_EVENTLINK</h4>
<div class=”pt-cv-content”>#_EVENTEXCERPT</div>
<div class=”pt-cv-meta-fields”>
#_LOCATIONTOWN
#_EVENTDATES
</div>
[/events_list]
</div>’);
}
endif; ?>
</div>
<?php
wp_link_pages();
if ( comments_open() || get_comments_number() ) {
comments_template();
}
if ( $have_sidebar ) { ?>
</article>
</section>
<?php }
if ( ( $sidebar_pos == ‘right’ ) || ( $sidebar_pos == ‘both’ ) ) { ?>
<aside class=”col-md-3 sidebar”>
<?php if ( is_active_sidebar( ‘Right Sidebar’ ) ) dynamic_sidebar( ‘Right Sidebar’ ); ?>
</aside>
<?php } ?>
</section>
<?php
if ( is_archive() ) :
echo ‘<hr class=”vertical-space2″><div class=”social-group-bottom”>’;
echo do_shortcode(‘[cn-social-icon width=”38″ height=”38″ margin=”30″ selected_icons=”1,2,3,4″]’);
echo ‘</div>’;
endif;
get_footer();