how to pull sticky post from wordpress

how to pull sticky post from wordpress

From wordpress 2.7 version wordpress introduced the new feature called sticky post. Sticky post will give you ability to show the most popular or your favorite post always top of the posts.

how to pull sticky post from wordpress

how to pull sticky post from wordpress
how to pull sticky post from wordpress

Sticky post feature is very nice for wordpress theme developer. Here I will show you how to create sticky post in wordpress.

When you are creating the new post or editing the wordpress post you can choose the stick ths post option. This is very simple way to create the sticky post.

If you want to some good styling to post then use following css code. Just open your style.css file from your template.


.sticky {
 background: #ccc;
 border: 5px solid blue;
}

If you want to show the sticky post in any specific page then use following code.


is_page('sticky page') {
query_posts(array('post__in'=>get_option('sticky_posts')));
}
how to pull sticky post from wordpress
how to pull sticky post from wordpress

Published by

Purab

I am Purab from India, Software development is my profession and teaching is my passion. Programmers blog dedicated to the JAVA, Python, PHP, DevOps and Opensource Frameworks. Purab's Github Repo Youtube Chanel Video Tutorials Connect to on LinkedIn

Leave a Reply

Your email address will not be published.