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
The topic ‘Sticky Not Working – Loop Edit?’ is closed to new replies.