Skip to content

Instantly share code, notes, and snippets.

@rashanoureldin
Created June 30, 2012 17:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rashanoureldin/3024754 to your computer and use it in GitHub Desktop.
Save rashanoureldin/3024754 to your computer and use it in GitHub Desktop.
portfolio-with-wordpress
<?php
/**
* Page Template
*
* …
*
* @package Thematic
* @subpackage Templates
*/
// calling the header.php
get_header();
// action hook for placing content above #container
thematic_abovecontainer();
?>
<div id="container">
<?php
// action hook for placing content above #content
thematic_abovecontent();
// filter for manipulating the element that wraps the content
echo apply_filters( 'thematic_open_id_content', '<div id="content">' . "\n" );
// calling the widget area 'page-top'
get_sidebar('page-top');
// start the loop
while ( have_posts() ) : the_post();
// action hook for placing content above #post
thematic_abovepost();
?>
<?php
echo '<div id="post-' . get_the_ID() . '" ';
// Checking for defined constant to enable Thematic's post classes
if ( ! ( THEMATIC_COMPATIBLE_POST_CLASS ) ) {
post_class();
echo '>';
} else {
echo 'class="';
thematic_post_class();
echo '">';
}
// creating the post header
thematic_postheader();
?>
<div class="entry-content">
<?php
$terms = get_terms("tagportifolio");
$count = count($terms);
echo '<ul id="portfolio-filter">';
echo '<li><a href="#all" title="">All</a></li>';
if ( $count > 0 ){
foreach ( $terms as $term ) {
$termname = strtolower($term->name);
$termname = str_replace(' ', '-', $termname);
echo '<li><a href="#'.$termname.'" title="" rel="'.$termname.'">'.$term->name.'</a></li>';
}
}
echo "</ul>";
?>
<?php
$loop = new WP_Query(array('post_type' => 'project', 'posts_per_page' => -1));
$count =0;
?>
<div id="portfolio-wrapper">
<ul id="portfolio-list">
<?php if ( $loop ) :
while ( $loop->have_posts() ) : $loop->the_post(); ?>
<?php
$terms = get_the_terms( $post->ID, 'tagportifolio' );
if ( $terms && ! is_wp_error( $terms ) ) :
$links = array();
foreach ( $terms as $term )
{
$links[] = $term->name;
}
$links = str_replace(' ', '-', $links);
$tax = join( " ", $links );
else :
$tax = '';
endif;
?>
<?php $infos = get_post_custom_values('_url'); ?>
<li class="portfolio-item <?php echo strtolower($tax); ?> all">
<div class="thumb"><a href="<?php the_permalink() ?>"><?php the_post_thumbnail( array(400, 160) ); ?></a></div>
<h3><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h3>
<p class="excerpt"><a href="<?php the_permalink() ?>"><?php echo get_the_excerpt(); ?></a></p>
<p class="links"><a href="<?php echo $infos[0]; ?>" target="_blank">Live Preview &rarr;</a> <a href="<?php the_permalink() ?>">More Details &rarr;</a></p>
</li>
<?php endwhile; else: ?>
<li class="error-not-found">Sorry, no portfolio entries for while.</li>
<?php endif; ?>
</ul>
<div class="clearboth"></div>
</div> <!-- end #portfolio-wrapper-->
<script>
jQuery(document).ready(function() {
jQuery("#portfolio-list").filterable();
});
</script>
</div><!-- .entry-content -->
</div><!-- #post -->
<?php
// action hook for inserting content below #post
thematic_belowpost();
// action hook for calling the comments_template
//thematic_comments_template();
// end loop
endwhile;
// calling the widget area 'page-bottom'
get_sidebar( 'page-bottom' );
?>
</div><!-- #content -->
<?php
// action hook for placing content below #content
thematic_belowcontent();
?>
</div><!-- #container -->
<?php
// action hook for placing content below #container
thematic_belowcontainer();
// calling the standard sidebar
//thematic_sidebar();
// calling footer.php
get_footer();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment