aboutsummaryrefslogtreecommitdiffstats
path: root/content-search.php
blob: 22b8d1c0cc920cb7c00f45ddbd6cc905be1e4c01 (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
<?php
  printf('
            <section class="main col-md-8">
                <div class="row titulo-seccion">
                    <div class="col-md-12">
                        <h3>' . __('You searched', 'Lidra') . ': '. 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();
                        $template_html = '
                            <div class="col-sm-6 post">
                                <div class="contenedor">
                                    <div class="thumb">
                                        <a href="%s">
                                        <figure>%s</figure>
                                        </a>
                                    </div>
                                    <article class="info">
                                        <h2 class="titulo"><a href="%s">%s</a></h2>
                                        <p class="fecha">%s&nbsp;' . __('by', 'Lidra') . '&nbsp;<a href="%s" rel="noopener noreferrer" target="_blank">%s</a></p>
                                        <div class="extracto">%s</div>
                                        <div class="categorias">
                                            %s
                                        </div>
                                    </article>
                                </div>
                            </div>
                        ';
                        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 items found with:', 'Lidra') . ' '. get_search_query() .' </p>' );
                endif;
            rewind_posts();
printf('
</div>
</section>
');