Skip to content

Instantly share code, notes, and snippets.

@kirasiris
Last active November 1, 2017 02:40
Show Gist options
  • Save kirasiris/af2bd4964a59f62f26ce3306a7bd6789 to your computer and use it in GitHub Desktop.
Save kirasiris/af2bd4964a59f62f26ce3306a7bd6789 to your computer and use it in GitHub Desktop.
<?php
/*
Template Name: Portfolio
Template Post Type: page
*/
?>
<?php get_header(); ?>
<div class="container">
<!-- Page Heading -->
<div class="row">
<div class="col-lg-12">
<div class="pull-left">
<button class="btn btn-sm btn-default" data-toggle="portfilter" data-target="all">All</button>
</div>
</div>
</div>
<br/>
<div class="row">
<?php
$portfolio_query = new WP_Query(array(
'post_type' => 'portfolios',
'order' => 'DESC',
));
?>
<?php if($portfolio_query->have_posts()) : while($portfolio_query->have_posts()) : $portfolio_query->the_post();?>
<div class="col-md-4" data-tag="all">
<div class="thumbnail">
<?php if(has_post_thumbnail()) : ?>
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('portfolio-page'); ?></a>
<?php endif; ?>
<div class="caption">
<a href="<?php the_permalink(); ?>"><h4><?php the_title(); ?></h4></a>
</div>
</div>
</div>
<?php endwhile; ?>
<?php else : ?>
<div class="alert alert-danger text-center"><p>Ningun portfolio encontrado</p></div>
<?php endif; ?>
</div>
</div><!-- /Container -->
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment