wordpress sticky header code example
Example 1: wordpress remove sticky header
.navbar-fixed-top {
position: absolute;
}
Example 2: wordpress query only sticky posts
// get sticky posts from DB
$sticky = get_option('sticky_posts');
// check if there are any
if (!empty($sticky)) {
// optional: sort the newest IDs first
rsort($sticky);
// override the query
$args = array(
'post__in' => $sticky
);
query_posts($args);
// the loop
while (have_posts()) {
the_post();
// your code
}
}