Sticky post not loading in custom loop

I've created a custom page template for my Homepage and 1 other content page. The idea is to list all latest posts and style the sticky posts differently. So I crafted the following code - http://pastebin.com/v5n62BWE

I noticed that the sticky class was missing on these pages, but it was showing fine on the default Blog page template.

Does BeTheme happen to remove the sticky class from normal pages ? Or, is there something I'm missing from the code there.

Comments

  • Hi,

    what sticky feature you mean exactly?
  • edited November 2015
    Wordpress' default sticky function.

    On my custom page template set for Homepage, the post_class didn't seem to generate the sticky class on 2 posts which I had marked as sticky.

    But in the single posts, I noticed the sticky class was added to them.
  • Sorry but we don't know what is wordpress default sticky function. Can you give us more details about this?
  • Wordpress uses the post_class function to automatically add default classes to its posts. One of the classes it adds to a blog post marked as "sticky" is .sticky

    But when I added the post_class to the list of posts in my custom page template, I realize those posts weren't marked as sticky here. However, when I view the single post, it had the .sticky class assigned to it.

    This was why I found it odd that the .sticky class didn't appear on my custom page template when I queried my list of posts.
  • Ok, thanks for this explanation. I'm going to forward this message to programmer and would speak with him about this on Monday.
Sign In or Register to comment.