Hello there,
I need a fix for my custom template. This template is called single-magazine.php and it should be showing one post from custom post type. The code i have right now has on problem though and that is this:
it’s always showing the lastest post. Example when I have http://mysite.com/magazine/june and http://musite.com/magazine/july.
when i click on the july link it show july, but when i click on june link it shows july post even the url says june. it’s always showing the most recent post form the custom post type.
here is the code i am using:
<code><?php get_header(); ?>
<div id=”magazine_full_width”>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class=”post”>
<div id=”single”>
<h1 class=”title” style=”padding-bottom:20px; padding-top:10px;”>DogCoach Magazine Issue <?php the_title(); ?></h1>
<div class=”postcontent”>
<?php the_content(); ?>
<p><iframe width=”945px” height=”700px” class=”magazine” src=”<?php echo get_post_meta($post->ID, “_zmags_url”, true); ?>”></iframe></p>
<p></p>
<p>How Do You Like this Issue? Please rate below</p>
<p><?php if(function_exists(‘the_ratings’)) { the_ratings(); } ?></p>
</div>
<div class=”cleaner”> </div>
<div id=”below_magazine_digital”>
<div id=”main” style=”float:left; display:block; width:625px;”>
<div id=”archive_ads” style=”float:none; margin-top:20px;”><?php include(TEMPLATEPATH . ‘/zone3.php’); ?></div>
<div id=”comments”>
</div><!– end #comments –>
</div><!– end #main –>
<?php endwhile; ?>
<?php endif; ?>
<div id=”sidebar”>
</div>
</div><!– end #below_magazine_digital –>
</div><!– end #single –>
<div class=”cleaner”> </div>
</div><!– end .post –>
</div><!– end .magazine_full_width –>
<?php get_footer(); ?></code>
i’ve tried wp_reset_query and it didn’t help, also the disabling sidebar, to see if there is now issue there.
Nothing works.
it should be fairly easy for somebody who know php and wordpress.
Thank you
Jan