Created
August 15, 2010 10:53
-
-
Save jankeesvw/525361 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Portfolio</h1> | |
<p> | |
In my portfolio you can view a selection of projects I worked on the last few years as a freelance developer. | |
More work can be shown upon request. If you have any questions please feel free to <a href="http://blog.base42.nl/contact">contact</a> me. | |
</p> | |
<div class="line"></div> | |
<?php | |
$pagenumber = get_query_var('paged') ? get_query_var('paged') : 1; | |
if($pagenumber == 1){ | |
/* BUILD THE LIST */ | |
query_posts('post_type=portfolio&posts_per_page=10000'); | |
if (have_posts()) : | |
$listPerTerm = array(); | |
while (have_posts()) : the_post(); | |
$categories = wp_get_object_terms($post->ID,'portfolio-categories'); | |
foreach ($categories as $category) { | |
if($listPerTerm[$category->name]){ | |
// okay | |
}else{ | |
$listPerTerm[$category->name] = array(); | |
} | |
$str = "<a href=\"".get_permalink()."\" rel=\"bookmark\" title=\"".the_title('','',false). " (" . get_the_time("F Y") .")\">".the_title('','',false)."</a> (".get_the_time("M Y").")"; | |
array_push($listPerTerm[$category->name],$str); | |
} | |
endwhile; | |
endif; | |
/* OUTPUT THE LIST */ | |
ksort($listPerTerm); | |
while ($items = current($listPerTerm)) { | |
echo "<div style=\"float: left; margin-right: 20px; margin-bottom:20px;\">"; | |
echo "<strong>".key($listPerTerm)."</strong>"; | |
echo "<ul>"; | |
foreach ($items as $item) { | |
echo "".$item."<br/>"; | |
} | |
echo "</ul>"; | |
echo "</div>"; | |
next($listPerTerm); | |
} | |
echo "<div class=\"line\"></div>"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment