Skip to content

Instantly share code, notes, and snippets.

@drjonnicholson
Last active October 18, 2015 13:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drjonnicholson/762a0e49c481a68bca83 to your computer and use it in GitHub Desktop.
Save drjonnicholson/762a0e49c481a68bca83 to your computer and use it in GitHub Desktop.
A bit of code I use in my child theme (of the Spacious theme) to present my portfolio projects. Rather than doing this on a page I created a page template with this code that loops through all project types and displays the respective projects.
<?php foreach ( get_terms( Jetpack_Portfolio::CUSTOM_TAXONOMY_TYPE, array( 'orderby' => 'id', 'order' => 'ASC' ) ) as $t ) { ?>
<section class="portfolio_section">
<h2><?php echo $t->name; ?></h2>
<p><?php echo $t->description; ?></p>
<?php
echo Jetpack_Portfolio::portfolio_shortcode(array(
'display_types' => false,
'display_tags' => true,
'display_content' => true,
'show_filter' => true,
'include_type' => $t->slug,
'include_tag' => false,
'columns' => 3,
'showposts' => -1,
'order' => 'DESC',
'orderby' => 'tit'
));
?>
</section>
<?php } ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment