Title: Sticky Not Working &#8211; Loop Edit?
Last modified: August 19, 2016

---

# Sticky Not Working – Loop Edit?

 *  [jprull](https://wordpress.org/support/users/jprull/)
 * (@jprull)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/sticky-not-working-loop-edit/)
 * Hi everyone, first post here. I’m a little bit stumped. I picked out this really
   nice template to edit for the company I work for. Everything has gone smoothly
   except one thing: Sticky doesn’t work! I’m assuming it’s the template because
   when I try another template, my sticky post does appear at top. With the current
   theme however, it does not.
 * So! It must be the loop code, right? Here’s what I have for the code:
 *     ```
       <?php get_header(); ?>
       <?php global $post; $myposts = get_posts('numberposts=1'); foreach($myposts as $post) : setup_postdata($post); ?>
   
       <!--start of Main Post-->
       <div class="mp">
       <div class="mct"></div><div class="mcc">
   
       <!--start of Post Data + Image -->
       <div class="postdata">
       <?php $postmeta = get_post_meta($post->ID, 'feature-image', true); if($postmeta != ""){ ?>
        <div class="postimg"> <?php echo $postmeta; ?> </div>
       <?php } ?>
       <div class="post">
        <div class="p-head">
         <h1><a href="<?php the_permalink(); ?>"><?php the_title()?></a></h1>
          <p class="p-date-cat"><?php the_time('F j, Y') ?> | In: <?php the_category(', ') ?></p>
        </div>
       <div class="p-con"><p><?php echo truncate($post->post_content,256); ?></p></div>
        <ul class="p-det">
         <li class="p-det-com"><?php comments_popup_link('No Comments', '(1) Comment', '(%) Comments'); ?></li>
         <li class="p-det-more"><a href="<?php the_permalink()?>">More ...</a></li>
        </ul>
       </div>
       </div>
       <!--End of Post Data + Image -->
   
       <!--Start Syndicate -->
       <div class="syn">
       <h3>Syndicate</h3>
        <ul>
         <li><a class="syn1" href="<?php bloginfo('rss2_url'); ?>">Subscribe to Articles RSS Feed</a></li>
         <li><a class="syn2" href="<?php bloginfo('comments_rss2_url'); ?>">Subscribe to Comments RSS Feed</a></li>
         <li><a class="syn3" href="#">Email Subscription</a></li>
         <li><a class="syn4" href="http://twitter.com/designdisease">Follow us on Twitter</a></li>
        </ul>
       </div>
       <!--End Syndicate -->
   
       </div><div class="mcb"></div>
       </div>
       <!--end of Main Post-->
       <?php endforeach; ?>
       ```
   
 * Now I’m no PHP expert here, but shouldn’t there be some mention of sticky for
   the template to order the posts properly? I’ve tried a few quick solutions I 
   could find on google but they haven’t worked. The website is jcems.org
 * Any solutions / ideas would be very helpful.. I’ve been looking for a fix for
   a few hours now. Thanks!
 * Josh

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [WP Libra](https://wordpress.org/support/users/wpbum/)
 * (@wpbum)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/sticky-not-working-loop-edit/#post-1577517)
 * Maybe instead of trying to figure that out you can just use a plugin
 * [http://wordpress.org/extend/plugins/wp-sticky/](http://wordpress.org/extend/plugins/wp-sticky/)
 * or you can give this a shot
 * [http://www.quickonlinetips.com/archives/2009/04/sticky-posts-in-wordpress-themes/](http://www.quickonlinetips.com/archives/2009/04/sticky-posts-in-wordpress-themes/)
 *  Thread Starter [jprull](https://wordpress.org/support/users/jprull/)
 * (@jprull)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/sticky-not-working-loop-edit/#post-1577518)
 * Thanks wpbum, I did try wp-sticky and it actually didn’t do anything. Not a single
   post moved no matter what settings I changed. Weird.
 * The second link is actually the first one I tried. Again, nothing moved or changed.:-/

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Sticky Not Working – Loop Edit?’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [jprull](https://wordpress.org/support/users/jprull/)
 * Last activity: [15 years, 10 months ago](https://wordpress.org/support/topic/sticky-not-working-loop-edit/#post-1577518)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
