-
Notifications
You must be signed in to change notification settings - Fork 0
/
page-imagenes-cuadros.php
69 lines (54 loc) · 1.6 KB
/
page-imagenes-cuadros.php
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
/*
* Template Name: Cuadros Featured
*/
?>
<?php get_header();
if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
$imgUrl = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
}else{
$imgUrl = get_template_directory_uri()."/img/noImagePostBg.png";
}
if ( have_posts() ) {
while ( have_posts() ) {
the_post(); ?>
<header class="intro-header" style="background-image: url('<?php echo $imgUrl ?>')">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="site-heading">
<h1><?php the_title()?></h1>
<hr class="small">
<span class="subheading"><?php the_excerpt() ?></span>
</div>
</div>
</div>
</div>
</header>
<?php } // end while
} // end if
?>
<?php $this_page_id=$wp_query->post->ID; ?>
<?php query_posts(array('showposts' => 20, 'post_parent' => $this_page_id, 'post_type' => 'page')) ?>
<?php if ( have_posts() ) : while ( have_posts() ) :
the_post(); ?>
<a href="<?php the_permalink() ?>">
<div class="fondo col-md-4 center-block">
<?php if(has_post_thumbnail())
{
the_post_thumbnail('cuadros_featured');
}
else{
echo "<img src=".get_template_directory_uri()."/img/noThumbPage.png>";
}
?>
<p><?php the_title() ?></p>
</div><!--/fondo-->
</a>
<?php endwhile; else: ?>
<p ><?php _e('No hay post. Sorry!'); ?></p>
<?php endif; ?>
</section><!--row-->
</article><!--/container-->
<hr>
<?php get_footer(); ?>