One post on index, with navigation
-
Hej!
On my site I have an index page that displays only the most resent post (the whole blog thing is not the main focus on the site). I managed this with the following code, which worked like a dream offline on my localhost, but now the site is online the previous/next navigation is gone.
I tried to replace the code with the showposts query, but that didn’t work as hoped… It looks fine, as long as you don’t use the navigation, cause it affects the rest of the site, but not the blog itself.
I would like to find a way to make things work online as well as they do off line.
Any thoughts?<?php if ( have_posts() ) : ?> <?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php static $count=0; if($count=="1"){break;} else{ ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php $count++; } ?> <?php endwhile; ?> <?php waningett_content_nav( 'nav-below' ); ?> <?php else : ?> <?php get_template_part( 'no-results', 'index' ); ?> <?php endif; ?>
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘One post on index, with navigation’ is closed to new replies.