Sunday, 19 May 2013

Post content stays the same but permalink changes ?

Post content stays the same but permalink changes ?

This is really weird. I made a posttype ' mediagallery ' via the plugin Types fields. I simply want to load the post content and switch the posts with a next & prev button in de sidebar.
The post content loads correct. But when i go to the next or prev post, the content stays the same. But only the permalink does changes. All posts are refering to the same post?
This is the code example:
<?php
$args = array( 'posts_per_page' => 1, 'post_type' => 'Mediagallery' );
query_posts($args);
if ( have_posts() ) : while ( have_posts() ) : the_post();
?>

<h1><?php the_title(); ?></h1>
<?php echo  apply_filters( 'the_content'  ,  types_render_field('mediaid')); ?>


<?php endwhile; ?>
<?php else : ?> <?php endif; ?> <?php wp_reset_query(); ?>
When i change post_per_page to 2 they correctly show up both, so the post it there but it only shows one (the newest post), i tried different things But somehow i can only show the newest and all posts are loading that content ?
i hope someone can help me,
Greetz

No comments:

Post a Comment