asiergogortza_theme/index.php

39 lines
1.3 KiB
PHP
Raw Normal View History

<?php
/**
* Template Name: Frontpage grid posts
*
*/
?>
<?php get_header(); ?>
<!-- header -->
<div class="row">
2017-01-27 23:17:33 +01:00
<div class="col-xs-12 col-sm-6 col-md-4">
<div class="sidebar-right1 span2">
<div class="head">
<?php if ( function_exists( 'jetpack_the_site_logo' ) ) jetpack_the_site_logo(); ?>
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a></h1>
<h4 class="site-description"><?php bloginfo( 'description' ); ?></h4>
</div>
<?php dynamic_sidebar( 'sidebar-left' ); ?>
</div>
</div>
2017-01-27 23:17:33 +01:00
<div class="col-xs-12 col-sm-6 col-md-8">
<div class=row">
<?php
$args = array( 'posts_per_page' => -1, 'category' => 10 );
$myposts = get_posts( $args );
foreach ( $myposts as $post ) : setup_postdata( $post );?>
<?php if (has_post_thumbnail()): ?>
<div class="col-md-12" style="padding:0; margin-bottom:20px;">
<a href="<?php the_permalink(); ?>"><div class="img-grid-link" style="background-size:cover; width:100%; height:200px; background-image:url('<?php the_post_thumbnail_url('medium'); ?>')"></div></a>
</div>
<?php endif; ?>
<?php endforeach; wp_reset_postdata();?>
</div> <!--endrow-->
<!--content-->
</div> <!--endcolmd8-->
</div><!--endrow-->
<?php get_footer(); ?>