SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2011
    Location
    Northern Ireland
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Something strange happening with my wordpress blog theme

    I coded a wordpress blog theme, and i have used a sticky post as a sort of "introductory" post on the blog... It displays exactly how i want it to at the top of the first page, however for some reason when you click on older posts to go to the second page, 2 or 3 posts down it appears again directly underneath a blog post? This is the loop I used.. Im wondering if anyone can help me spot the problem? As obviously I only want the sticky post to display at the top of the first page only...

    HTML Code:
    			<section id="posts">
    			
    			<?php if (have_posts ()) : ?>
    			<?php while(have_posts()) : the_post(); ?>
    
    			<?php if(is_sticky()):?>
    				<article id="sticky_post"><?php the_content(); ?></article>
    			<?php elseif(!is_sticky()):?>
    
    				<article>
    					<h2 class="post_title"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
    					
    					<p class="date"><?php the_time('F jS, Y') ?><br />
    					Posted in: <?php the_category(', ') ?></p>
    					
    					<div class="grey"><?php the_content(''); ?></div>
    					
    					<a href="<?php the_permalink() ?>" class="readmore">Read More...</a>
    				</article>
    
    			<?php endif;?>
    			
    			<?php endwhile; ?>
    			
    			<ul id="older_newer">
    
    				<li id="older"><?php next_posts_link('Older Posts') ?></li>
    				<li id="newer"><?php previous_posts_link('Newer Posts') ?></li>
    
    			</ul>
    			
    			<?php else : ?>
    			
    				<h2>Nothing Here!</h2>
    				
    			<?php endif; ?>
    			
    			</section>

  2. #2
    Barefoot on the Moon! silver trophy Force Flow's Avatar
    Join Date
    Jul 2003
    Location
    Northeastern USA
    Posts
    4,606
    Mentioned
    56 Post(s)
    Tagged
    1 Thread(s)
    You're missing a lot of semicolons at the end of several PHP statements.
    Visit The Blog | Follow On Twitter
    301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
    Can be hosted on and utilize your own domain

  3. #3
    SitePoint Enthusiast
    Join Date
    Dec 2011
    Location
    Northern Ireland
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    added them in but its made absolutely no difference, same issue still happening


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •