{"id":7016,"date":"2009-04-08T22:22:25","date_gmt":"2009-04-08T16:52:25","guid":{"rendered":"https:\/\/www.quickonlinetips.com\/archives\/?p=7016"},"modified":"2026-10-13T13:36:57","modified_gmt":"2026-10-13T08:06:57","slug":"sticky-posts-in-wordpress-themes","status":"publish","type":"post","link":"https:\/\/www.quickonlinetips.com\/archives\/2009\/04\/sticky-posts-in-wordpress-themes\/","title":{"rendered":"Sticky Posts in WordPress Themes: How to Use and Style Them"},"content":{"rendered":"<p>Sticky posts let you pin an important post to the top of your WordPress blog page, no matter when it was published. The sticky feature arrived in WordPress 2.7, but in 2009 our theme did not support it, so ticking the sticky box did nothing. Here is how sticky posts in WordPress themes work in 2026, how to mark a post sticky, and how to add sticky post support and styling to classic and block themes.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-large wp-image-63829\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/sticky-posts-wordpress-themes-1024x538.webp\" alt=\"How to use sticky posts in WordPress themes\" width=\"1024\" height=\"538\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/sticky-posts-wordpress-themes-1024x538.webp 1024w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/sticky-posts-wordpress-themes-300x158.webp 300w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/sticky-posts-wordpress-themes-150x79.webp 150w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/sticky-posts-wordpress-themes-768x403.webp 768w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/sticky-posts-wordpress-themes.webp 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p><strong>Quick answer:<\/strong> To make a sticky post in WordPress, open the post and tick <strong>Stick to the top of the blog<\/strong> in the Post settings sidebar (block editor), or tick <strong>Make this post sticky<\/strong> in Quick Edit. Most modern themes support sticky posts automatically. In a block theme, the Query Loop block has a Sticky posts setting to include, exclude or show only sticky posts.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_89 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6ae7ea36bb52d\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #1a202c;color:#1a202c\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #1a202c;color:#1a202c\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6ae7ea36bb52d\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2009\/04\/sticky-posts-in-wordpress-themes\/#How_to_make_a_post_sticky_in_WordPress\" >How to make a post sticky in WordPress<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2009\/04\/sticky-posts-in-wordpress-themes\/#Block_editor\" >Block editor<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2009\/04\/sticky-posts-in-wordpress-themes\/#Quick_Edit_or_Classic_Editor\" >Quick Edit or Classic Editor<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2009\/04\/sticky-posts-in-wordpress-themes\/#Sticky_posts_in_block_themes\" >Sticky posts in block themes<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2009\/04\/sticky-posts-in-wordpress-themes\/#Add_sticky_post_support_to_a_classic_theme\" >Add sticky post support to a classic theme<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2009\/04\/sticky-posts-in-wordpress-themes\/#Show_or_hide_sticky_posts_in_custom_queries\" >Show or hide sticky posts in custom queries<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2009\/04\/sticky-posts-in-wordpress-themes\/#Tips_for_using_sticky_posts\" >Tips for using sticky posts<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2009\/04\/sticky-posts-in-wordpress-themes\/#FAQ\" >FAQ<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2009\/04\/sticky-posts-in-wordpress-themes\/#Why_is_my_sticky_post_not_at_the_top\" >Why is my sticky post not at the top?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2009\/04\/sticky-posts-in-wordpress-themes\/#Can_pages_be_sticky_in_WordPress\" >Can pages be sticky in WordPress?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2009\/04\/sticky-posts-in-wordpress-themes\/#How_many_sticky_posts_can_I_have\" >How many sticky posts can I have?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2009\/04\/sticky-posts-in-wordpress-themes\/#Do_sticky_posts_help_SEO\" >Do sticky posts help SEO?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"How_to_make_a_post_sticky_in_WordPress\"><\/span>How to make a post sticky in WordPress<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"Block_editor\"><\/span>Block editor<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ol>\n<li>Open the post in the editor.<\/li>\n<li>In the right sidebar, open the <strong>Post<\/strong> tab.<\/li>\n<li>Tick <strong>Stick to the top of the blog<\/strong> (in the Status or Summary panel) and click Update.<\/li>\n<\/ol>\n<h3><span class=\"ez-toc-section\" id=\"Quick_Edit_or_Classic_Editor\"><\/span>Quick Edit or Classic Editor<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ol>\n<li>Go to Posts &gt; All Posts and hover over the post.<\/li>\n<li>Click <strong>Quick Edit<\/strong> and tick <strong>Make this post sticky<\/strong>, then Update.<\/li>\n<li>In the Classic Editor, click Edit next to Visibility in the Publish box and tick <strong>Stick this post to the front page<\/strong>.<\/li>\n<\/ol>\n<p>You can mark several posts as sticky. They appear at the top of your main blog page, newest first.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Sticky_posts_in_block_themes\"><\/span>Sticky posts in block themes<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>In block themes such as Twenty Twenty-Five, the blog page uses a Query Loop block. Select it in the Site Editor and use the <strong>Sticky posts<\/strong> option:<\/p>\n<ul>\n<li><strong>Include:<\/strong> sticky posts appear first, then other posts.<\/li>\n<li><strong>Exclude:<\/strong> sticky posts are left out of this loop.<\/li>\n<li><strong>Only:<\/strong> show only sticky posts, useful for a &#8220;Featured&#8221; section on the homepage.<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Add_sticky_post_support_to_a_classic_theme\"><\/span>Add sticky post support to a classic theme<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>If you use an old or custom classic theme where sticky posts do not stand out, these steps add support, just as we did in 2009.<\/p>\n<ol>\n<li>In index.php (or the template part that shows posts), wrap each post in an element that uses <code>post_class()<\/code>:\n<pre><code>&lt;article &lt;?php post_class(); ?&gt;&gt;\r\n  &lt;h2&gt;&lt;a href=\"&lt;?php the_permalink(); ?&gt;\"&gt;&lt;?php the_title(); ?&gt;&lt;\/a&gt;&lt;\/h2&gt;\r\n  &lt;?php the_excerpt(); ?&gt;\r\n&lt;\/article&gt;<\/code><\/pre>\n<\/li>\n<li>WordPress adds the <code>sticky<\/code> class to sticky posts on the main blog page. Style it in style.css:\n<pre><code>.sticky {\r\n  background: #fff8e6;\r\n  border-left: 4px solid #F28C1E;\r\n  padding: 1rem;\r\n}<\/code><\/pre>\n<\/li>\n<li>To show a label, check <code>is_sticky()<\/code> in the loop:\n<pre><code>&lt;?php if ( is_sticky() ) : ?&gt;\r\n  &lt;span class=\"sticky-label\"&gt;Featured&lt;\/span&gt;\r\n&lt;?php endif; ?&gt;<\/code><\/pre>\n<\/li>\n<\/ol>\n<h2><span class=\"ez-toc-section\" id=\"Show_or_hide_sticky_posts_in_custom_queries\"><\/span>Show or hide sticky posts in custom queries<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li>Sticky posts only float to the top on the main blog page by default.<\/li>\n<li>In a custom WP_Query, use <code>'ignore_sticky_posts' =&gt; true<\/code> to stop them jumping to the top.<\/li>\n<li>To list only sticky posts, use <code>'post__in' =&gt; get_option( 'sticky_posts' )<\/code>.<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Tips_for_using_sticky_posts\"><\/span>Tips for using sticky posts<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li>Keep only a few sticky posts, so new content is still visible.<\/li>\n<li>Use them for your best guides, announcements or start-here pages.<\/li>\n<li>Review them every few months and swap in fresher posts.<\/li>\n<\/ul>\n<p>Want featured images to stand out too? See how to add <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2012\/06\/post-thumbnails-wordpress-theme\/\">post thumbnails to WordPress themes<\/a>.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"FAQ\"><\/span>FAQ<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"Why_is_my_sticky_post_not_at_the_top\"><\/span>Why is my sticky post not at the top?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Sticky posts only lead the main blog posts page. Category pages, custom homepages and some theme layouts ignore them unless the theme or Query Loop is set to include them.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Can_pages_be_sticky_in_WordPress\"><\/span>Can pages be sticky in WordPress?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>No. The sticky feature is only for posts.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_many_sticky_posts_can_I_have\"><\/span>How many sticky posts can I have?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>There is no limit, but too many push your latest posts down.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Do_sticky_posts_help_SEO\"><\/span>Do sticky posts help SEO?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>They can send more internal links and visitors to your key posts, but they do not directly change rankings.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sticky posts let you pin an important post to the top of your WordPress blog page, no matter when it&#8230;<\/p>\n","protected":false},"author":4,"featured_media":63829,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"default","_kad_post_title":"default","_kad_post_layout":"default","_kad_post_sidebar_id":"","_kad_post_content_style":"default","_kad_post_vertical_padding":"default","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[6],"tags":[17],"class_list":["post-7016","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogging","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/7016","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/comments?post=7016"}],"version-history":[{"count":3,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/7016\/revisions"}],"predecessor-version":[{"id":65290,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/7016\/revisions\/65290"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media\/63829"}],"wp:attachment":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media?parent=7016"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/categories?post=7016"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/tags?post=7016"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}