aboutsummaryrefslogtreecommitdiffstats
path: root/content-search.php
diff options
context:
space:
mode:
Diffstat (limited to 'content-search.php')
-rw-r--r--content-search.php62
1 files changed, 62 insertions, 0 deletions
diff --git a/content-search.php b/content-search.php
new file mode 100644
index 0000000..3301399
--- /dev/null
+++ b/content-search.php
@@ -0,0 +1,62 @@
+<?php
+printf ('
+ <section class="main col-md-8">
+ <div class="row titulo-seccion">
+ <div class="col-md-12">
+ <h3>' . __('Has buscado', 'libre') . ': '. get_search_query() .'</h3>
+ </div>
+ </div>
+
+ <div class="row posts">
+ ');
+ //Lógica de the_loop
+ //Si (hay entradas)
+ //mientras (hay entradas)
+ //muestra la info de las entradas
+ //Si no
+ //no hay entradas publicadas
+ if( have_posts() ):
+ while( have_posts() ):
+ the_post();
+ //echo '';
+ $template_html = '
+ <article class="col-sm-6 post">
+ <div class="contenedor">
+ <div class="thumb">
+ <a href="%s">
+ %s
+ </a>
+ </div>
+ <div class="info">
+ <h2 class="titulo"><a href="%s">%s</a></h2>
+ <p class="fecha">%s</p>
+ <div class="extracto">%s</div>
+ <div class="categorias">
+ %s
+ </div>
+ </div>
+ </div>
+ </article>
+ ';
+ printf(
+ $template_html,
+ get_the_permalink(),
+ // has_post_thumbnail(),
+ // the_post_thumbnail( 'homepage-thumb' ),
+ get_the_post_thumbnail(),
+ get_the_permalink(),
+ get_the_title(),
+ get_the_time( 'd-M-Y' ),
+ get_the_excerpt(),
+ //the_category()
+ get_the_category_list()
+ );
+ endwhile;
+ else:
+ printf( '<p>' . __('No hay entradas', 'libre') . '</p>' );
+ endif;
+ rewind_posts();
+printf('
+</div>
+</section>
+');