aboutsummaryrefslogtreecommitdiffstats
path: root/content-search.php
blob: ba3759c5ad42032f288c36e113b03ff10223914e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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">
                                        <figure>%s</figure>
                                        </a>
                                    </div>
                                    <div class="info">
                                        <h2 class="titulo"><a href="%s">%s</a></h2>
                                        <p class="fecha">%s&nbsp;' . __('por', 'libre') . '&nbsp;<a href="%s" target="_blank">%s</a></p>
                                        <div class="extracto">%s</div>
                                        <div class="categorias">
                                            %s
                                        </div>
                                    </div>
                                </div>
                            </article>
                        ';
                        printf(
                            $template_html,
                            get_the_permalink(),
                            get_the_post_thumbnail(  null, '', $attr = array( 'title'   => get_the_title() ) ),
                            get_the_permalink(),
                            get_the_title(),
                            get_the_time( 'd-M-Y' ),
                            get_the_author_meta('user_url'),
                            get_the_author(),
                            get_the_excerpt(),
                            //the_category()
                            get_the_category_list()
                    );
                endwhile;
            else:
                printf( '<p>' . __('No se encontraron art&iacute;culos con:', 'libre') . ' '. get_search_query() .' </p>' );
            endif;
            rewind_posts();
printf('
</div>
</section>
');