File: /www/wwwroot/pulitocucito.it/wp-content/themes/laundry/search.php
<?php
/**
* The template for displaying search results pages.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#search-result
*
* @package Laundry
*/
get_header();
$laundry_opt = laundry_get_options();
$theme = isset( $laundry_opt['laundry_demo_select'] ) ? $laundry_opt['laundry_demo_select'] : 1;
if ( $theme == '2' ) { ?>
<div class="section-inner lazyload subpage-bg-left subpage-bg__position06" data-bg="<?php echo LAUNDRY_IMG_URL; ?>/wrapper-subpage-left06.png">
<div class="lazyload subpage-bg-right subpage-bg__position06" data-bg="<?php echo LAUNDRY_IMG_URL; ?>/wrapper-subpage-right06.png">
<div class="container container-fluid-lg">
<?php
$blogview = '';
if ( isset( $_GET['blogview'] ) && $_GET['blogview'] == 'grid-view' ) {
$blogview = 'grid-view';
}
if ( isset( $laundry_opt['blogpost_layout_view'] ) && $laundry_opt['blogpost_layout_view'] == 'grid-view' ) {
$blogview = 'grid-view';
}
if ( $blogview == 'grid-view' ) {
?>
<div class="blog-isotope">
<?php
if ( have_posts() ) :
?>
<div class="post_loop_cont_wrap">
<?php
if ( is_home() && ! is_front_page() ) :
?>
<?php
endif;
?>
<div class="post_loop_cont">
<?php
/* Start the Loop */
while ( have_posts() ) :
the_post();
/*
* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
?>
<div class="blog-post">
<div class="post-image">
<?php get_template_part( 'template-parts/media/content', get_post_format() ); ?>
</div>
<div class="post-content">
<ul class="post-meta">
<li class="post-message"><i class="icon icon-chat-bubble"></i><span><?php comments_number( '0', '1', '%' ); ?></span></li>
<li><?php echo get_the_date(); ?></li>
</ul>
<h3 class="post-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<div class="post-author"><?php esc_html_e( 'by', 'laundry' ); ?> <?php printf( esc_html__( '%s', 'laundry' ), get_the_author() ); ?></div>
<div class="post-teaser">
<?php the_excerpt(); ?>
</div>
</div>
</div>
<?php
endwhile;
?>
</div>
<div class="clearfix"></div>
<?php
if ( isset( $laundry_opt['blogpost_pagination_load'] ) && $laundry_opt['blogpost_pagination_load'] == 'navigation' ) {
the_posts_navigation();
} elseif ( isset( $laundry_opt['blogpost_pagination_load'] ) && $laundry_opt['blogpost_pagination_load'] == 'ajax_load' ) {
?>
<div id="postPreload"></div>
<div id="post_ajax_load"></div>
<div class="text-center"><a class="btn btn-default view-more-post ajax_load_post_btn" data-post_per_load="<?php echo get_option( 'posts_per_page' ); ?>" data-load="post-more-ajax-card.txt" ><?php esc_html_e( 'More Posts', 'laundry' ); ?></a>
<img class="ajax_load_post_img" src="<?php echo esc_url( LAUNDRY_IMG_URL ); ?>/ajax-loader.gif" />
</div>
<div class="divider divider-lg"></div>
<?php
} else {
the_posts_pagination();
}
?>
</div>
<?php
else :
get_template_part( 'template-parts/content', 'none' );
endif;
?>
</div>
</div>
</div>
<?php } else { ?>
<div class="row">
<?php if ( is_active_sidebar( 'sidebar-1' ) ) { ?>
<div class="col-12 col-sm-7 col-md-7 col-xl-8">
<?php } else { ?>
<div class="col-12 column-center">
<?php } ?>
<?php
if ( have_posts() ) :
?>
<div class="tt-blog-list">
<?php
/* Start the Loop */
while ( have_posts() ) :
the_post();
?>
<div class="tt-item">
<div class="blog-obj">
<?php
$quote = get_post_meta( get_the_ID(), 'framework-quote', true );
$audio_content = get_post_meta( get_the_ID(), 'framework-audio-markup', true );
if ( empty( $quote ) and empty( $audio_content ) ) {
get_template_part( 'template-parts/media/content', get_post_format() );
} else {
echo '<div class="blog-obj__img"></div>';
}
?>
<div class="blog-obj__data row">
<div class="col-auto">
<div class="data__time"><span><?php echo get_the_date( 'd' ); ?></span> <?php echo get_the_date( 'M' ); ?></div>
<div class="data__posted">
<i class="tt-icon icons-1621561"></i>
<?php esc_html_e( 'Posted by:', 'laundry' ); ?> <a href="<?php the_permalink(); ?>"><?php printf( esc_html__( '%s', 'laundry' ), get_the_author() ); ?></a>
</div>
<div class="data__comments">
<a href="<?php the_permalink(); ?>"><i class="tt-icon icons-983899"></i><?php comments_number( '0 Comments', '1 Comment', '%' ); ?></a>
</div>
</div>
<div class="col-auto ml-left">
<?php do_action( 'laundry_social_share' ); ?>
</div>
</div>
<h3 class="blog-obj__title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<?php the_excerpt(); ?>
<?php
if ( ! empty( $quote ) || ! empty( $audio_content ) ) {
get_template_part( 'template-parts/media/content', get_post_format() );
}
?>
<div class="blog-obj__row-btn">
<a href="<?php the_permalink(); ?>" class="tt-btn tt-btn__wide">
<span class="mask"><?php esc_html_e( 'Read more', 'laundry' ); ?></span>
<div class="button"><?php esc_html_e( 'Read more', 'laundry' ); ?></div>
</a>
</div>
</div>
</div>
<?php
endwhile;
?>
</div>
<?php
if ( isset( $laundry_opt['blogpost_pagination_load'] ) && $laundry_opt['blogpost_pagination_load'] == 'navigation' ) {
the_posts_navigation();
} elseif ( isset( $laundry_opt['blogpost_pagination_load'] ) && $laundry_opt['blogpost_pagination_load'] == 'ajax_load' ) {
?>
<div id="postPreload"></div>
<div class="text-center"><a class="btn btn-default view-more-post ajax_load_post_btn" data-post_per_load="<?php echo get_option( 'posts_per_page' ); ?>" data-load="post-more-ajax-card.txt" ><?php esc_html_e( 'More Posts', 'laundry' ); ?></a>
<img class="ajax_load_post_img" src="<?php echo esc_url( LAUNDRY_IMG_URL . '/ajax-loader.gif' ); ?>" />
</div>
<div class="divider divider-lg"></div>
<?php
} else {
$pagination = get_the_posts_pagination(
array(
'prev_text' => esc_html__( 'Prev', 'laundry' ),
'next_text' => esc_html__( 'Next', 'laundry' ),
'type' => 'list',
'class' => 'tt-pagination',
)
);
echo wp_kses_post( $pagination );
}
?>
<?php
else :
get_template_part( 'template-parts/content', 'none' );
endif;
?>
</div>
<?php if ( is_active_sidebar( 'sidebar-1' ) ) { ?>
<div class="divider d-block d-sm-none"></div>
<div class="col-12 col-sm-5 col-md-5 col-xl-4 rightColumn tt-aside">
<?php get_sidebar(); ?>
</div>
<?php } ?>
</div>
<?php } ?>
</div>
<?php } else { ?>
<div class="container">
<div class="row">
<div class="col-md-9 column-center">
<?php
if ( have_posts() ) :
?>
<h1 class="text-center decor color">
<?php printf( esc_html__( 'Search Results for: %s', 'laundry' ), '<span>' . get_search_query() . '</span>' ); ?>
</h1>
<div class="post_loop_cont_wrap">
<?php
if ( is_home() && ! is_front_page() ) :
?>
<?php
endif;
?>
<div class="post_loop_cont">
<?php
/* Start the Loop */
while ( have_posts() ) :
the_post();
?>
<div class="blog-post">
<?php get_template_part( 'template-parts/media/content', get_post_format() ); ?>
<ul class="post-meta">
<li class="post-message"><i class="icon icon-chat-bubble"></i><span><?php comments_number( '0', '1', '%' ); ?></span></li>
<li><?php echo get_the_date( 'd / m / Y' ); ?></li>
</ul>
<h3 class="post-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<div class="post-author"><?php esc_html_e( 'by', 'laundry' ); ?> <?php printf( esc_html__( '%s', 'laundry' ), get_the_author() ); ?></div>
<div class="post-teaser">
<p><?php the_excerpt(); ?></p>
</div>
<a href="<?php the_permalink(); ?>" class="btn btn-default btn-blue"><?php esc_html_e( 'Read more', 'laundry' ); ?></a>
</div>
<?php
endwhile;
?>
</div>
<div class="clearfix"></div>
<?php
if ( isset( $laundry_opt['blogpost_pagination_load'] ) && $laundry_opt['blogpost_pagination_load'] == 'navigation' ) {
the_posts_navigation();
} elseif ( isset( $laundry_opt['blogpost_pagination_load'] ) && $laundry_opt['blogpost_pagination_load'] == 'ajax_load' ) {
?>
<div id="postPreload"></div>
<div class="text-center"><a class="btn btn-default view-more-post ajax_load_post_btn" data-post_per_load="<?php echo get_option( 'posts_per_page' ); ?>" data-load="post-more-ajax-card.txt" ><?php esc_html_e( 'More Posts', 'laundry' ); ?></a>
<img class="ajax_load_post_img" src="<?php echo esc_url( LAUNDRY_IMG_URL ); ?>/ajax-loader.gif" />
</div>
<div class="divider divider-lg"></div>
<?php
} else {
the_posts_pagination();
}
?>
</div>
<?php else : ?>
<div class="container-fluid search_404_form">
<?php
get_template_part( 'template-parts/content', 'none' );
?>
</div>
<?php endif; ?>
</div><!-- .col-md-9 -->
<div class="col-md-3 column-right">
<?php get_sidebar(); ?>
</div>
</div><!-- .row -->
</div><!-- .container -->
<?php
}
get_footer();