aboutsummaryrefslogtreecommitdiffstats
path: root/content.php
blob: 4cb5950756eb99dfe19d1ba441854b3c6d9fd6ea (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
63
64
65
66
67
68
69
<?php
    printf('
            <section class="main col-md-8">
                <div class="row titulo-seccion">
                    <div class="col-md-12">
                        <h3>' . __('The most recent', 'Lidra') . '</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(),
                            // has_post_thumbnail(),
                            // the_post_thumbnail( 'homepage-thumb' ),
                            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 post', 'Lidra') . '</p>' );
                endif;
            rewind_posts();
                printf('
                </div>
                    <div class="row paginacion">
                        <div class="col-md-12">
                            <div class="pagination">');
                            if (function_exists('wp_pagenavi')) { wp_pagenavi(); } //wp_pagenavi();
                    printf('</div>
                        </div>
                    </div>
            </section>
            ');