HEX
Server: Apache/2.4.34 (Red Hat) OpenSSL/1.0.2k-fips
System: Linux WORDPRESS 3.10.0-1160.118.1.el7.x86_64 #1 SMP Thu Apr 4 03:33:23 EDT 2024 x86_64
User: digital (1020)
PHP: 7.2.24
Disabled: NONE
Upload Files
File: /datos/www/www.colombia.co/public_html/wp-content/themes/colombia2016/search.php
<?php get_header(); ?>

<?php
	global $wp_query, $paged;
	$num = $wp_query->found_posts;
	$qty = $wp_query->query_vars['posts_per_archive_page'];
	$search_query = get_search_query();
	$ourCurrentPage = get_query_var('paged');
    $args=array('s'=> $search_query ,'order'=> 'DESC', 'posts_per_page'=>$qty, 'paged' => $ourCurrentPage );
    $query=new WP_Query($args);
    $locale = get_locale();
 ?>

<main role="main" class="l-flex">
	<div id="category-header">
		<div class="l-container l-flex">
			<div class="cat-header-container">
				<h2 class="cat-name"><?php _e('Resultados de búsqueda', 'colombia'); ?></h2>
				<h1 class="category-title cat-title"><?php printf(__('Se han encontrado %d resultados según tu búsqueda:', 'colombia'), $num); ?></h1> 
				<div class="cat-description"><?php echo $search_query; ?></div>
			</div>
		</div>
	</div>
	<div id="content-wrapper" class="l-container l-flex">
		<section id="posts" class="l-flex">
			<?php
    			if( $query->have_posts()): 
    				while ( $query->have_posts()): $query->the_post(); ?>
				 <?php
					$url_exploded = explode('/', parse_url(get_the_permalink(), PHP_URL_PATH));
					$parent_category = 'category-'.$url_exploded[1];
				?>
				<article <?php post_class($parent_category); ?> id="post-<?php the_ID(); ?>">
					<figure class="post-img">
						<a href="<?php the_permalink(); ?>">
							<?php
								if(has_post_thumbnail()){
									the_post_thumbnail();
								}
								else{
									$thumb = get_field('thumb_post');
							?>
									<img src="<?php echo $thumb['sizes']['medium']; ?>" alt="<?php echo $thumb['alt']; ?>" title="<?php echo $thumb['title']; ?>" />
							<?php
								}
							?>
						</a>
					</figure>
					<div class="post-info">
						<div class="post-category">
							<?php the_category(); ?>
						</div>
						<div class="post-title">
							<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
						</div>
						<div class="post-excerpt">
							<!-- <a href="<?php the_permalink(); ?>"><?php the_excerpt(); ?></a> -->
						</div>
					</div>
				</article>
			<?php 	endwhile; ?>
				<div id="pagination"><?php echo paginate_links( array('total' => $query->max_num_pages ));?></div>
			<?php
				    else:?>
						<?php if($locale == "es_CO"){ ?>
							<p> <?php _e('Lo sentimos no hay articulos relacionados con tu busqueda.');?></p>
						<?php }else if($locale == "en_US"){ ?>
							<p> <?php _e('Sorry, there are no articles related to your search'); ?> </p>	
						<?php }else if($locale == "fr_FR") { ?>
							<p> <?php _e('Désolé, il n,y a aucun article lié à votre recherche.'); ?> </p>
						<?php }else{ ?>
							<p> <?php _e('Lo sentimos no hay articulos relacionados con tu busqueda.'); ?> </p>
						<?php } 		
				    endif; ?>

			<!-- <?php if($wp_query->max_num_pages > 1){	?>
				 <div id="pagination">
					<button id="load-more" class="btn-secondary" type="button" data-current-page="<?php echo $paged; ?>" data-total-pages="<?php echo $wp_query->max_num_pages; ?>">Cargar más</button>
				</div> 
			<?php } ?> -->
		</section>
	 <?php get_sidebar(); ?>
	</div>
</main>
<?php get_footer(); ?>