Exemple #1
0
<?php

print '<main class="item  i-b  w-70  main">';
if (have_posts()) {
    print '<ul class="container loop-home">';
    while (have_posts()) {
        the_post();
        $template_html = '
				<li class="item  i-b  w-50  post">
					<a href="%s">
						<h2>%s</h2>
						<picture>
							<source srcset="%s" media="(min-width: 600px)">
	 						<img src="%s">
						</picture>
						<p>%s</p>
					</a>
				</li>
			';
        printf($template_html, get_the_permalink(), get_the_title(), main_image_url('large'), main_image_url('thumbnail'), get_the_excerpt());
    }
    print '</ul>';
} else {
    print '<p class="error">No hay entradas</p>';
}
rewind_posts();
print '</main>';
Exemple #2
0
print '<main class="item  i-b  w-70  main">';
if (have_posts()) {
    while (have_posts()) {
        the_post();
        $template_html = '
				<article class="post">
					<h2>%s</h2>
					<div>%s</div>
					<h6>Imagen responsive</h6>
					<picture>
						<source srcset="%s" media="(min-width: 600px)">
 						<img src="%s">
					</picture>
					<a href="%s">%s</a>
					<p>%s-%s</p>
					%s
					<p class="post-categories">%s</p>
					<p>%s</p>
					<p>%s</p>
					<div class="the-content">%s</div>
				</article>
				<hr>
			';
        printf($template_html, get_the_title(), get_the_post_thumbnail($post_id, 'large'), main_image_url('large'), main_image_url('thumbnail'), get_the_permalink(), get_the_permalink(), get_the_date(), get_the_time(), get_the_excerpt(), get_the_category_list(' - '), get_the_tag_list('<i>', ', ', '</i>'), get_the_author(), get_the_content());
    }
} else {
    print '<p class="error">No hay entradas</p>';
}
rewind_posts();
print '</main>';