Permalink and postlink not working
-
Hi guys,
I have a thumbnails on my homepage that directly link to an information page of that certain thumbnail and it only works with one thumbnail, though the permalink on the thumbnail in included in my while. So all that happens is that you keep going to the details page of the LAST entered thumbnail.
As well as for my previous/next postlinks on the details page to go to a different project, it for some reason changes the link of the page but shows the content of the same page it was on.
I think both the permalink and post link have the same issue but I just don’t know how to solve this.
Code:
<div id= "thumbnail"> <?php $args = array( 'post_type' => 'project', 'posts_per_page' => 10 ); $query = new WP_Query( $args ); if ( $query->have_posts()) : ?> <ul> <?php while ( $query->have_posts()) : $query->the_post(); ?> <li> <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('medium' ); ?></a> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> </li> <?php endwhile; wp_reset_postdata();?> </ul> <?php endif; ?> </div>
The above code is a while outside the standard while.
<div class="navigation"><p> <?php previous_post_link()."/?p=".$post->ID; ?> </p></div> <div class="navigation2"> <?php next_post_link('« %link'); ?> </div> </div>
The above code is all in a while but it’s to much to paste.
- The topic ‘Permalink and postlink not working’ is closed to new replies.