Iâm using WordPress as a CMS for this site
http://www.seadragon.co.uk/new_site/portfolio.html
…and itâs the first time Iâve ever used wordpress so sorry if I get the terminology wrong….
My client needs to be able to add new projects (case studies) to the portfolio section, and each of them can have itâs own slideshow.
I thought they could create a new post category for each project slideshow, and then a new page for each project.
The problem I have is how to get my client to associate the post category with the project page (so I can pull the correct category posts in to the slideshow dynamically). I thought maybe I could try and get them to use the same naming convention for the category she creates (for the project sildeshow) and the page she creates (for the project)? Does this sound like itâll work? Is there a better way I can do this, or another plugin that would be better suited.
Hereâs the code from my portfolio template… currently the categoryID is hard coded in the query.
<div id="slider">
<?php
//Reset Query
//wp_reset_query();
global $wp_query;
$query = "post_type=post&cat=5";
$wp_query = new WP_Query( $query );
if ( have_posts() ) : while ( have_posts() ) : the_post();
echo get_the_post_thumbnail($post->ID, 'large');
?>
<?php
endwhile; endif;
?>
</div>
<script type="text/javascript">
$(window).load(function() {
$('#slider').nivoSlider();
});
</script>
Hope that makes some sense?
Many thanks.
Edit: Fixed formatting so embedded code sample would display
A better solution would be to create a “Project” post type and a custom taxonomy to separate the different types of projects.
I recently did this on my own website because I wanted a way to keep my projects separate from the rest of my content. I used jQuery cycle instead of Nivo but the concept is the same.
Custom post types have a built in user interface so it wont be confusing for your client to add new projects.
It will also allow you to customize the way the “Projects” are displayed using a single-project.php template file.
I won’t go into how to register post types because The Codex explains this very well but I will show you how to get all the attached images to the post and display them in the slider.