File: /home/globfdxw/diasporameetsafrica.com/wp-content/themes/lavelo/search.php
<?php
/*
* The search template file.
* Author & Copyright: wpoceans
* URL: http://themeforest.net/user/wpoceans
*/
get_header();
// Metabox
$lavelo_id = ( isset( $post ) ) ? $post->ID : 0;
$lavelo_id = ( is_home() ) ? get_option( 'page_for_posts' ) : $lavelo_id;
$lavelo_meta = get_post_meta( $lavelo_id, 'page_type_metabox', true );
if ( $lavelo_meta ) {
$lavelo_content_padding = isset( $lavelo_meta['content_spacings'] ) ? $lavelo_meta['content_spacings'] : '';
} else { $lavelo_content_padding = ''; }
// Padding - Metabox
if ($lavelo_content_padding && $lavelo_content_padding !== 'padding-default') {
$lavelo_content_top_spacings = $lavelo_meta['content_top_spacings'];
$lavelo_content_bottom_spacings = $lavelo_meta['content_bottom_spacings'];
if ($lavelo_content_padding === 'padding-custom') {
$lavelo_content_top_spacings = $lavelo_content_top_spacings ? 'padding-top:'. lavelo_check_px($lavelo_content_top_spacings) .';' : '';
$lavelo_content_bottom_spacings = $lavelo_content_bottom_spacings ? 'padding-bottom:'. lavelo_check_px($lavelo_content_bottom_spacings) .';' : '';
$lavelo_custom_padding = $lavelo_content_top_spacings . $lavelo_content_bottom_spacings;
} else {
$lavelo_custom_padding = '';
}
} else {
$lavelo_custom_padding = '';
}
// Theme Options
$lavelo_sidebar_position = cs_get_option( 'blog_sidebar_position' );
$lavelo_sidebar_position = $lavelo_sidebar_position ?$lavelo_sidebar_position : 'sidebar-right';
$lavelo_blog_widget = cs_get_option( 'blog_widget' );
$lavelo_blog_widget = $lavelo_blog_widget ? $lavelo_blog_widget : 'sidebar-1';
if (isset($_GET['sidebar'])) {
$lavelo_sidebar_position = $_GET['sidebar'];
}
$lavelo_sidebar_position = $lavelo_sidebar_position ? $lavelo_sidebar_position : 'sidebar-right';
// Sidebar Position
if ( $lavelo_sidebar_position === 'sidebar-hide' ) {
$layout_class = 'col-md-12';
$lavelo_sidebar_class = 'hide-sidebar';
} elseif ( $lavelo_sidebar_position === 'sidebar-left' && is_active_sidebar( $lavelo_blog_widget ) ) {
$layout_class = 'col-md-8 col-md-push-4';
$lavelo_sidebar_class = 'left-sidebar';
} elseif( is_active_sidebar( $lavelo_blog_widget ) ) {
$layout_class = 'col-md-8';
$lavelo_sidebar_class = 'right-sidebar';
} else {
$layout_class = 'col-md-12';
$lavelo_sidebar_class = 'hide-sidebar';
}
?>
<div class="blog-pg-section section-padding">
<div class="container content-area <?php echo esc_attr( $lavelo_content_padding .' '. $lavelo_sidebar_class ); ?>" style="<?php echo esc_attr( $lavelo_custom_padding ); ?>">
<div class="row">
<div class="blog-wrap <?php echo esc_attr( $layout_class ); ?>">
<div class="blog-content">
<?php
if ( have_posts() ) :
/* Start the Loop */
while ( have_posts() ) : the_post();
get_template_part( 'theme-layouts/post/content' );
endwhile;
else :
get_template_part( 'theme-layouts/post/content', 'none' );
endif;
lavelo_paging_nav();
wp_reset_postdata(); ?>
</div>
</div><!-- Content Area -->
<?php
if ( $lavelo_sidebar_position !== 'sidebar-hide' && is_active_sidebar( $lavelo_blog_widget ) ) {
get_sidebar(); // Sidebar
} ?>
</div>
</div>
</div>
<?php
get_footer();