<?php /** * * Front Page * * @package PrimeBulletin */ get_header(); $primebulletin_default = primebulletin_get_default_theme_options(); $primebulletin_default = primebulletin_get_default_theme_options(); $sidebar = esc_attr( get_theme_mod( 'global_sidebar_layout', $primebulletin_default['global_sidebar_layout'] ) ); if( is_single() || is_page() ){ $primebulletin_post_sidebar = esc_attr( get_post_meta( $post->ID, 'primebulletin_post_sidebar_option', true ) ); if( $primebulletin_post_sidebar == 'global-sidebar' || empty( $primebulletin_post_sidebar ) ){ $sidebar = $sidebar; }else{ $sidebar = $primebulletin_post_sidebar; } } $twp_primebulletin_home_sections_33 = get_theme_mod( 'twp_primebulletin_home_sections_33', json_encode( $primebulletin_default['twp_primebulletin_home_sections_33'] ) ); $paged_active = false; if ( !is_paged() ) { $paged_active = true; } $twp_primebulletin_home_sections_33 = json_decode( $twp_primebulletin_home_sections_33 ); if( $twp_primebulletin_home_sections_33 ){ ?> <div class="wrapper"> <div class="column-row"> <div id="primary" class="content-area"> <main id="main" class="site-main" role="main"> <?php foreach ( $twp_primebulletin_home_sections_33 as $primebulletin_home_section ) { $home_section_type = isset( $primebulletin_home_section->home_section_type ) ? $primebulletin_home_section->home_section_type : ''; switch ($home_section_type) { case 'main-banner': $ed_slider_blocks = isset( $primebulletin_home_section->section_ed ) ? $primebulletin_home_section->section_ed : ''; if ( $ed_slider_blocks == 'yes' && $paged_active ) { primebulletin_main_banner( $primebulletin_home_section ); } break; case 'latest-posts-blocks': $ed_latest_posts_blocks = isset( $primebulletin_home_section->section_ed ) ? $primebulletin_home_section->section_ed : ''; if ( $ed_latest_posts_blocks == 'yes' ) { primebulletin_latest_blocks( $primebulletin_home_section ); } break; case 'tiles-blocks': $ed_tiles_block = isset( $primebulletin_home_section->section_ed ) ? $primebulletin_home_section->section_ed : ''; if ( $ed_tiles_block == 'yes' && $paged_active ) { primebulletin_tiles_block_section( $primebulletin_home_section ); } break; case 'banner-blocks-1': $ed_banner_blocks_1 = isset( $primebulletin_home_section->section_ed ) ? $primebulletin_home_section->section_ed : ''; if ( $ed_banner_blocks_1 == 'yes' && $paged_active ) { primebulletin_banner_block_1_section( $primebulletin_home_section ); } break; case 'advertise-blocks': $ed_advertise_blocks = isset( $primebulletin_home_section->section_ed ) ? $primebulletin_home_section->section_ed : ''; if ( $ed_advertise_blocks == 'yes' && $paged_active ) { primebulletin_advertise_block( $primebulletin_home_section ); } break; case 'home-widget-area': $ed_home_widget_area = isset( $primebulletin_home_section->section_ed ) ? $primebulletin_home_section->section_ed : ''; if ( $ed_home_widget_area == 'yes' && $paged_active ) { primebulletin_case_home_widget_area_block( $primebulletin_home_section ); } break; default: break; } } ?> </main><!-- #main --> </div> <?php if( $sidebar != 'no-sidebar' ){ get_sidebar(); } ?> </div> </div> <?php } get_footer();