<?php get_header();
$term = $_GET['term'];
if (have_posts()) : ?>

		<h8>
			<?php /* Search Count */ $allsearch = &new WP_Query("s=$s&showposts=-1"); $key = wp_specialchars($s, 1); $count = $allsearch->post_count; _e(''); _e
			(''); echo $count . ' '; _e
			('resultados para '); _e
			('<strong>&#8220;'); echo $key; _e('&#8221;</strong>');
			wp_reset_query(); ?>
		</h8>

		<?php $term = (isset($_GET['s'])) ? $_GET['s'] : '';
			echo do_shortcode('[ajax_load_more post_type="post" search="'. $term .'" orderby="relevance" posts_per_page="8" css_classes="plain-text" button_label="Mostrar Mais"]');
		?>
	</div>
	
	<?php else : ?>

	<article class="full">
		<h8>Nenhum resultado</h8>
		Ah, poxa! Sua busca não obteve nenhum resultado.
		
		<h2>Categorias</h2>
		<?php
		$categories = get_categories( array(
		'orderby' => 'name',
		'order'   => 'ASC'
			) );

		foreach( $categories as $category ) {
		echo '<li><a href="' . get_category_link($category->term_id) . '">' . $category->name . '</a></li>';   
		} ?>
		
		<hr>
		
		<h2>Tags</h2>
		
		<?php wp_tag_cloud('format=list'); ?>
		
	</article>

	<?php endif; get_footer(); ?>