aboutsummaryrefslogtreecommitdiffstats
path: root/content-single.php
blob: 14a5723e0871c0d37d30f8233ec3ca4aff648d28 (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
<?php
  printf('
            <div class="main col-md-8">
                <div class="row single-post">
        ');
                //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-12 post">
                                <div class="contenedor">
                                    <div class="thumb">
                                        <figure>%s</figure>
                                    </div>
                                    <article class="info">
                                        <h2 class="titulo">%s</h2>
                                        <p class="fecha">%s&nbsp;' . __('by', 'Lidra') . '&nbsp;%s <a href="%s" rel="noopener noreferrer" target="_blank">%s</a></p>
                                        <div class="categorias">
                                            %s
                                        </div>
                        ';
                        printf(
                            $template_html,
                            get_the_post_thumbnail(),
                            get_the_title(),
                            get_the_time( 'd-M-Y' ),
                            get_avatar( get_the_author_meta('ID'), 18 , '', 'author'),
                            get_the_author_meta('user_url'),
                            get_the_author(),
                            get_the_category_list()
                            //get_the_content()
                            //the_category()
                        );
                                printf('<div class="texto">');
                                                the_content();
                                printf('</div>
                                    </article>
                                </div>
                            </div>'
                        );
                        comments_template();
                    endwhile;
                else:
                    printf( '<p>' . __('No post', 'Lidra') . '</p>' );
                endif;
                rewind_posts();
        printf('</div>
            </div>');