I am using the plugins and settings below. I am having some problems displaying my custom post types. I am concentrating on the printers custom post type. I have them displaying under the custom taxonomies section and have created 4 taxonomies (manufactures) so that bit is ok. (http://developmentscene.co/CKH/printers/)
The Problem
When I click on a post on the page above it displays all posts in that category. I just want it to display the post that the link you clicked on and only that post. I have tried to do this using ('posts_per_page' => 1,) But this bit of code just displays the same first post for each post I click on in the category page.
My Ideal Solution
So what I was thinking in my mind was to say only show one post with the ID of the link you clicked previously in the category. I dont know if this is the best way but I have put my code below.
<?php get_header(); ?>
<div id="wrap" class="container">
<section id="content" class="primary" role="main">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php endwhile; ?>
<?php endif; ?>
<?php $printers = new WP_Query(array(
'post_type' => 'printers',
'posts_per_page' => 1,
)); ?>
<?php while($printers->have_posts()) : $printers->the_post(the_ID()); ?>
<h2 class="post-title" style="color:#333;" ><?php the_title(); ?> - <?php echo the_ID();?></h2>
<hr >
<p><?php the_content(); ?></p>
<p> </p>
<?php the_post_thumbnail(); ?>
<br />
</section>
<section id="sidebar" class="secondary clearfix" role="complementary">
<h3 class="widgettitle" ><b>Features and Benefits</b></h3>
<?php $benefits = get_field( "features-and-benefits" );
if($benefits){
echo '<table cellspacing="0" cellpadding="0"><tbody>' ;
foreach($benefits as $benefits){
echo '<tr><td><p>' . $benefits['features'] . '</p></td></tr>' ;
}
echo '</tbody></table>';
}
?>
<br />
<h3 class="widgettitle" ><b>More Information</b></h3>
<?php $specifications = get_field( "specifications" );;
if($specifications){
echo '<table cellspacing="0" cellpadding="0"><tbody>' ;
foreach($specifications as $specifications){
echo '<tr><td><p>' . '<a target="_blank" href="http://' . $specifications['link'] . '/">' . $specifications['details'] . '</a></p></td></tr>' ;
}
echo '</tbody></table>';
}
?>
</section>
<?php endwhile; ?>
</div>
<?php get_footer(); ?>
Settings
Plugins Used:
* Custom Fields
* Custom Post Type UI
I also have permalinks set to postname.