Sticky Post on WordPress

May 5th, 2007 at 10:53 pm

There was a request at the WordPress Ideas page to make it easy to create sticky posts.

I think it’s a feature sorely lacking in WordPress. Not only would it be useful to have a particular post stay at the top of the home page, it would be great if I could post some sticky random text there as well.

So I spent an hour trying to scratch this itch, and came up with this Sticky Post plugin.

Once you activate it, you can set the ID of the sticky post and create your own block of sticky text. To find the ID of any post, go to Manage → Posts and the ID is on the left-most column.

Best of all, there is no need to edit any template.

Download Sticky Post here. (Version 1.4, 3 July 2007)

CHANGE LOG

1.0 to 1.1:

  1. Remove get_magic_quotes_gpc() since WordPress adds slashes to GPC.

1.1 to 1.2:

  1. If the ’stickied’ post also appears in the home page, that post is removed from the loop to avoid appearing twice.

1.2 to 1.3:

  1. You can now show up to 3 sticky notes.

1.3 to 1.4:

  1. Set as many sticky posts as you like! Edit the source file and change the AC_STICKY_POSTS_COUNT constant.
  2. Important!If you are upgrading from a previous version, your first sticky post will be missing. Please enter it again in the control panel and all will be fine.

WP Text Ads Like this post? Buy an ad and drive visitors to your site

About the author

I'm Alex Choo and I live in sunny Singapore. I'm also the developer of WP Text Ads, a WordPress plugin that lets bloggers sell ads directly to advertisers so that they pay 0% in commissions and earn 100% in profits.

Feel free to drop me a note anytime you wish. You should also subscribe to the low volume email announcement list for WP Text Ads below.

Email address:

Comments 119

  1. Alex Choo wrote:

    If you are having issues of stubborn backslashes to quotes, please download version 1.1 which contains the fix.

    Posted 19 May 2007 at 8:52 am
  2. petite wrote:

    I’ve just used this, and it’s great, except that my sticky post is very recent and now shows twice on my front page. Is there any way to avoid this?

    Posted 24 May 2007 at 5:49 pm
  3. petite wrote:

    apart from putting in an old date, obviously, which I’ve just done

    Posted 24 May 2007 at 5:50 pm
  4. Alex Choo wrote:

    Petite,

    I’ll work on a solution for that.

    Thanks for trying it. :)

    Posted 24 May 2007 at 10:01 pm
  5. Alex Choo wrote:

    Ok, version 1.2 has a fix for the double post.

    Posted 24 May 2007 at 10:28 pm
  6. Marcus wrote:

    Hi Alex,
    I downloaded your plug in but I can’t quite understand WHERE I’m supposed to set the ID of the sticky post. I guess it’s just me being stupid, but any clarification would be much appreciated.
    Thanks in advance,
    Marcus

    Posted 28 May 2007 at 4:06 am
  7. Marcus wrote:

    Actually, I had a look at the plugin code and I found it, in the Options panel. Thanks for a great plugin!

    Posted 28 May 2007 at 4:09 am
  8. Marcus wrote:

    Btw, if you intend to develop this plugin any further, may I humbly share with you two suggestions for improvement:

    1) Allow for several sticky posts (allowing the user to decide which one of them should be no 1, no 2, etc)

    2) Make it easier to access, maybe movie it to the “write post”-screen. Making it a “custom field” instead, perhaps? If so, it would be really really nice if when you mark a post as “sticky no1″, it automatically “pushes” all other sticky’s down one step.

    That would make this plugin a real “killer app” for Wordpress-powered CMS sites.

    Again, thanks a lot!

    Posted 28 May 2007 at 4:16 am
  9. Alex Choo wrote:

    Hi Marcus,

    Thanks for using this plugin. The reason why I placed the plugin under ‘Options’ is because that’s where most people put it.

    It would be great if WordPress could create a top level menu specifically for plugins to avoid any confusion.

    Your suggestion to have multiple sticky posts is a great one. I will work on that.

    Posted 28 May 2007 at 10:33 am
  10. kyle wrote:

    Hi,
    Thanks for creating this plugin, it’s good stuff. The only bit I’d like to change is the ability to snuff out the date for sticky posts, so they could be treated as sort of ‘mini’-pages. Is there a way to do this? (I realize I can just add custom html, but not as clean as using a post)

    Posted 06 Jun 2007 at 6:31 am
  11. Alex Choo wrote:

    Hi Kyle,

    That won’t be easy because each theme has it’s own way of presenting dates.

    What you want would require code specific to your theme, I think.

    But if you’d like some help to get you started, please contact me directly.

    Posted 07 Jun 2007 at 4:01 pm
  12. kyle wrote:

    Hey Alex,

    I wasn’t aware the date css varied, but after looking into it I understand your point. Here is the bit of javascript I created to hide the date on the post and put it in footer.php under presentation -> html inserts in the wp-admin tool, seems to work fine.

    To use just change the idOfPostToHide value to whatever post you’re hiding (and depending on how your dates are displayed change the # in the childnodes.

    function hidePost() {
    idOfPostToHide = ‘post-3′
    theDateDiv = document.getElementById(idOfPostToHide).childNodes[1].childNodes[1];
    theDateDiv.style.display = ‘none’;
    }

    hidePost()

    Posted 08 Jun 2007 at 1:16 pm
  13. kyle wrote:

    I noticed wp stripped the script tags in my comment, so you’ll have to add those back to make it work in the footer.

    Posted 08 Jun 2007 at 1:17 pm
  14. kyle wrote:

    heh, a better name for the js funciton would probably be hidePostDate, not hideDate

    Posted 08 Jun 2007 at 1:18 pm
  15. Alex Choo wrote:

    Thanks Kyle.

    I’m sure folks will find your tip useful!

    Posted 08 Jun 2007 at 1:24 pm
  16. Marcus wrote:

    I don’t know where I’d be without your plug-in, Alex. My CMS would be crap without it.
    That said, could you please please please increase the amount of possible “stickies” to 5?

    Best,
    Marcus

    Posted 03 Jul 2007 at 6:00 pm
  17. Alex Choo wrote:

    Marcus,

    I’ve just uploaded the latest version of Sticky Post.

    You can set as many sticky posts as you like. Just edit the source file and set the AC_STICKY_POSTS_COUNT constant to the number you want.

    Try not to go overboard though :)

    Posted 03 Jul 2007 at 10:42 pm
  18. M.T. wrote:

    Hi, just wondering if there’s a way to merge the functionality of this plugin with WP-Sticky :)

    http://lesterchan.net/wordpress/readme/wp-sticky.html

    Posted 03 Aug 2007 at 2:28 am
  19. Alex Choo wrote:

    Hey MT,

    What features are there in WP-Sticky that are not in Sticky Post? And vice versa?

    Posted 03 Aug 2007 at 12:21 pm
  20. SEO Blogger wrote:

    Hi Alex, I’m just wondering if it’s possible to allow php codes in the box where you can “Enter your custom HTML to show at the top of home page.”

    This is because I want to be able to add a “Highest Rated Posts…”, “Recent Posts”, “Popular Posts,” et cetera…I don’t want to change the template every time I decide whether to show “Highest Rated Posts” & “Recent Posts” vs. “Recent Posts” & “Popular Posts.”

    I hope I make sense =P.

    Posted 11 Oct 2007 at 2:37 am
  21. Alex Choo wrote:

    @ SEO Blogger

    Hi.

    That’s a difficult task because WordPress will not execute PHP code in strings of text output. So it’s not a limitation of my plugin, but the architecture itself.

    But I said ‘difficult’, and not ‘impossible’ right? :)

    There is a plugin that allows you to run php code inside text. You might want to try that.

    Alex

    Posted 11 Oct 2007 at 10:54 am
  22. Alex Choo wrote:

    @ SEO Blogger,

    Here’s the link to the plugin that will execute PHP code in text strings.

    http://dev.wp-plugins.org/wiki/RunPHP

    Good luck, and let us know if it works for you. Perhaps you could share the code with us for others to benefit from it.

    Posted 11 Oct 2007 at 11:03 am
  23. Brian Pelton wrote:

    Hey Alex,

    Just downloaded the plugin and activated. I’m having a problem. I set the options for 2 sticky posts. Then when I went to make a post, I could write a title but I can’t seem to post my article. Please help!

    Posted 13 Oct 2007 at 8:55 am
  24. Alex Choo wrote:

    Brian, can you describe the problem a bit more? Can I have the url of your blog?

    1) Is the plugin causing your whole blog to fail?

    2) Did you try removing the post IDs in Sticky Post to see if it works?

    3) “Then when I went to make a post, I could write a title but I can’t seem to post my article” - Can you explain this a bit more? You mean you can write a new post, but when you post, it fails? What error message do you get?

    4) Notwithstanding the problem of posting a new article, does Sticky Post actually work for you?

    Alex

    Posted 13 Oct 2007 at 12:18 pm
  25. pozmu wrote:

    Thanks, it works with WP 2.5 :)

    Posted 11 Apr 2008 at 1:49 am
  26. liga wrote:

    Nice plugin - something I was looking for. And indeed, it works with current wordpress version. Very handy.
    Big THANKS!

    Bye

    Posted 25 Apr 2008 at 1:33 am
  27. Cal MacDonald wrote:

    Not working at all for me, Enter the post ID click save and the post in question still does not appear at the top

    Posted 10 Aug 2008 at 7:15 pm
  28. Mapa3M wrote:

    ух ты как крууууууууууутооооооо))

    Posted 23 Sep 2008 at 3:28 am
  29. sesna wrote:

    Ну жесть конечно…

    Posted 23 Sep 2008 at 4:06 am
  30. S.I.V. wrote:

    класс)мне понра)особенно!

    Posted 23 Sep 2008 at 4:26 am
  31. Диалог-К wrote:

    Большое спасибо! Есть ещё повод получить удовольствие… С вашего разрешения, беру.

    Posted 23 Sep 2008 at 11:10 pm
  32. Мастер wrote:

    Забавно. :-)

    Posted 23 Sep 2008 at 11:28 pm
  33. Канцтоварищ wrote:

    Я от них безума!

    Posted 24 Sep 2008 at 12:00 am
  34. ЛЁША wrote:

    Видела…видела….слишком всё утрировано, но круто)))

    Posted 24 Sep 2008 at 12:19 am
  35. Suhrob wrote:

    супер оригинально

    Posted 24 Sep 2008 at 6:11 pm
  36. Евгений Титов wrote:

    Трогательно)

    Posted 27 Sep 2008 at 5:32 am
  37. ValeK wrote:

    все может быть=))))))

    Posted 30 Sep 2008 at 1:29 am
  38. VladimiR wrote:

    хорошая подборка)

    Posted 30 Sep 2008 at 3:12 am
  39. Wizard wrote:

    Красота, особенно первая фотка

    Posted 30 Sep 2008 at 3:48 am
  40. VBA wrote:

    Читаешь это и думаешь….

    Posted 30 Sep 2008 at 4:24 am
  41. martin wrote:

    Thanks for the great plugin, very handy. I am suing it on my blog. The only think i dont like ist that the sticky post is also displayed on the second page of listed posts. I would like the stick post to be only displayed only on the first or home page.

    Is this possible?

    Posted 05 Oct 2008 at 2:50 am
  42. suicidalsam wrote:

    is this plugin only for posts? or can i place some text with html(no relation to existing or new posts) and show it as sticky that only shows up on homepage?

    Posted 07 Oct 2008 at 1:15 am
  43. Art wrote:

    спасибо большое.

    Posted 08 Oct 2008 at 6:48 am
  44. factor5 wrote:

    Just found your plugin and I love it. Took me a moment to find its config page but now Im settled and oh so happy!

    Thanks alot!

    Posted 08 Oct 2008 at 7:39 am
  45. koles wrote:

    да,но это еще и не все…

    Posted 09 Oct 2008 at 4:11 am
  46. MAN wrote:

    круто..взяла почти все))

    Posted 09 Oct 2008 at 4:32 am
  47. Romeo wrote:

    мило!

    Posted 09 Oct 2008 at 4:54 am
  48. SergeyR wrote:

    ha ))

    Posted 09 Oct 2008 at 5:33 am
  49. serg111 wrote:

    Не пойму в чём дело, но у меня тока 2 картинки загрузилось. ((( А ваще понравились! :)

    Posted 10 Oct 2008 at 1:03 am
  50. MikeN wrote:

    Забавно )

    Posted 10 Oct 2008 at 3:46 am
  51. max wrote:

    очень красиво, вот бы у нас так сделали

    Posted 10 Oct 2008 at 4:07 am
  52. RM wrote:

    Классно!

    Posted 10 Oct 2008 at 4:33 am
  53. Ramcke wrote:

    Какая прелесть!!!!!!!!!!!!)

    Posted 11 Oct 2008 at 3:03 am
  54. PDV wrote:

    супер оригинально

    Posted 11 Oct 2008 at 9:08 pm
  55. saishan wrote:

    жжот))

    Posted 11 Oct 2008 at 11:49 pm
  56. OVEN wrote:

    здорово)

    Posted 13 Oct 2008 at 12:04 am
  57. Virus wrote:

    ну что тут скажешь…

    Posted 13 Oct 2008 at 12:44 am
  58. Ktulu wrote:

    ух ты как крууууууууууутооооооо))

    Posted 13 Oct 2008 at 10:05 pm
  59. legolex wrote:

    Это должно быть в цитатнике

    Posted 13 Oct 2008 at 10:58 pm
  60. Mapa3M wrote:

    Смеяться не грешно, но признаваться в этом при чтении подобной информации по крайней мере удивило меня!:))

    Posted 14 Oct 2008 at 12:24 am
  61. gregory wrote:

    Трогательно)

    Posted 14 Oct 2008 at 1:08 am
  62. dokas wrote:

    “Хорошо пишешь”

    Posted 14 Oct 2008 at 3:37 am
  63. gans wrote:

    отлично!!! Все супер!

    Posted 14 Oct 2008 at 12:09 pm
  64. dkrasny wrote:

    “ваш блог у меня в фаворитах”

    Posted 15 Oct 2008 at 2:05 am
  65. DimaAB wrote:

    “отличный блог! отличные посты”

    Posted 15 Oct 2008 at 5:33 am
  66. dimix wrote:

    “здорово!”

    Posted 15 Oct 2008 at 4:14 pm
  67. dfg wrote:

    “соглашусь с автором”

    Posted 15 Oct 2008 at 5:13 pm
  68. Den Siaopin wrote:

    “Отличный пост”

    Posted 16 Oct 2008 at 2:25 am
  69. Yasik wrote:

    спасибо большое.

    Posted 16 Oct 2008 at 3:21 am
  70. dok wrote:

    Видела…видела….слишком всё утрировано, но круто)))

    Posted 16 Oct 2008 at 3:43 am
  71. BSA wrote:

    “Мне очень помогали ваши записи”

    Posted 16 Oct 2008 at 4:47 am
  72. bsi wrote:

    “Достаточно интересная и познавательная тема”

    Posted 16 Oct 2008 at 12:32 pm
  73. Bolek wrote:

    “отличный пример стоящего материала”

    Posted 16 Oct 2008 at 1:40 pm
  74. Bisko wrote:

    “Мало кто может похвастаться такой смекалкой, как у автора”

    Posted 18 Oct 2008 at 4:26 am
  75. Леван wrote:

    “Пост хорош”

    Posted 18 Oct 2008 at 5:18 pm
  76. bocha wrote:

    “отличный пример стоящего материала”

    Posted 20 Oct 2008 at 12:59 am
  77. FACKS wrote:

    Видела…видела….слишком всё утрировано, но круто)))

    Posted 24 Oct 2008 at 7:57 pm
  78. GVS wrote:

    Красота, особенно первая фотка

    Posted 24 Oct 2008 at 9:13 pm
  79. fog wrote:

    все может быть=))))))

    Posted 24 Oct 2008 at 11:24 pm
  80. Hexpl0rer wrote:

    ух ты как крууууууууууутооооооо))

    Posted 25 Oct 2008 at 3:08 pm
  81. gregory wrote:

    Интересненько=)

    Posted 25 Oct 2008 at 4:37 pm
  82. Hell wrote:

    класс)мне понра)особенно!

    Posted 25 Oct 2008 at 6:15 pm
  83. Jaxta wrote:

    а в каком это городе,какой стране??очень креативненько!!!!!)))))

    Posted 25 Oct 2008 at 8:02 pm
  84. AlexVol wrote:

    Красота, особенно первая фотка

    Posted 26 Oct 2008 at 2:28 am
  85. Alex_MAG wrote:

    класс)мне понра)особенно!

    Posted 26 Oct 2008 at 4:36 am
  86. Alex_Jackson wrote:

    ух ты как крууууууууууутооооооо))

    Posted 26 Oct 2008 at 5:41 am
  87. Ander wrote:

    круто..взяла почти все))

    Posted 26 Oct 2008 at 6:44 am
  88. Alek€ wrote:

    =))))))

    Posted 26 Oct 2008 at 1:56 pm
  89. Alex K wrote:

    спасибо большое.

    Posted 27 Oct 2008 at 1:11 am
  90. AAKakaKAA wrote:

    дяяя….старая темка, но ми тут нету^^ даже если не по картинкам смотреть))) нету и фсё^_^

    Posted 27 Oct 2008 at 4:12 am
  91. Jonik1 wrote:

    Большое спасибо! Есть ещё повод получить удовольствие… С вашего разрешения, беру.

    Posted 28 Oct 2008 at 3:58 am
  92. SEO-bloger wrote:

    отличная статья, интересно было читать

    Posted 28 Oct 2008 at 5:52 am
  93. ШНУРОК wrote:

    Невероятно красиво!

    Posted 28 Oct 2008 at 6:51 am
  94. Купив wrote:

    В нашем магазине велосипедов Вы можете купить велосипеды МЕРИДА, АТОМ, CANNONDALE, HARO, IRON HORSE, PANTHER, велозапчасти, велоаксессуары и детские

    Posted 31 Oct 2008 at 7:35 am
  95. Tevs wrote:

    Мировая премьера: 14 декабря 2007. Премьера в России: 15 мая 2008. Ссылки на фильм: - фильм на imdb.com · - официальный сайт фильма · - русский сайт фильма

    Posted 01 Nov 2008 at 12:26 pm
  96. opef wrote:

    Thanks for the post,

    Posted 05 Nov 2008 at 8:09 pm
  97. Asya wrote:

    The people in such cases, said so - Avos will be alive, maybe pomrem.

    Posted 06 Nov 2008 at 1:22 pm
  98. Владислав wrote:

    Хороший пост! Подчерпнул для себя много нового и интересного!
    Пойду ссылку другу дам в аське :)

    Posted 07 Nov 2008 at 9:27 am
  99. erez wrote:

    Thanks for the great tips.

    Posted 12 Nov 2008 at 7:01 am
  100. Umix wrote:

    I completely agree

    Posted 13 Nov 2008 at 5:24 am
  101. zura wrote:

    Hmm. Good question.

    Posted 17 Nov 2008 at 7:15 pm
  102. axel wrote:

    I came across. Thank you.

    Posted 18 Nov 2008 at 4:44 am
  103. Юлиан wrote:

    Текст действительно понравился, особенно здесь последний абзац хорош :)

    Posted 20 Nov 2008 at 7:17 am
  104. Линза wrote:

    Интернет-магазин контактных линз и средств по уходу за ними. … линз могут получить консультацию врача – офтальмолога Кабинета Контактной Коррекции Зрения

    Posted 21 Nov 2008 at 11:36 pm
  105. peter wrote:

    book of the month #1

    Posted 23 Nov 2008 at 1:20 am
  106. Лиза wrote:

    На нашем сайте Вы встретите: посудомоечные машины, микроволновые печи, стиральные машины, холодильники и другую встраиваемую технику, качество и надежность у нас!

    Posted 26 Nov 2008 at 7:09 pm
  107. Дмитрий wrote:

    Продажа табака, сигарет, кальянов и сигарилл, так же аксессуаров для сигарет гильотины, пепельницы и гигрометры

    Posted 28 Nov 2008 at 10:00 am
  108. WILDLIFE wrote:

    Где-то я уже что-то похожее читал, причём практически один в один… :)

    Posted 29 Nov 2008 at 8:10 am
  109. dracosmetics wrote:

    ежедневного ухода за кожей лица и тела.

    Posted 29 Nov 2008 at 4:39 pm
  110. Laguna wrote:

    Даа… В некоторые жизненные моменты волосы могут шевелиться не только на голове :)

    Posted 08 Dec 2008 at 7:43 am
  111. darkgriever wrote:

    Hmm. Good post.

    Posted 12 Dec 2008 at 6:02 am
  112. tiekiroli wrote:

    Админ. Хотелось бы поговорить насчёт рекламы в вашем блоге. Если вы согласны, отпишите ваши условия на e-mail. Благодарю

    Posted 21 Dec 2008 at 11:56 pm
  113. Ульяна wrote:

    Интернет магазин бытовой техники UKIO - стиральные машины, холодильники, посудомоечные машины, вытяжки, СВЧ печи, бойлеры. Техника фирм ELECTROLUX, SIEMENS, ZANUSSI, ARISTON, BOSCH.

    Posted 24 Dec 2008 at 1:37 pm
  114. Дарья wrote:

    Интернет магазин подарков - Банк подарков. Самый необычный магазин подарков, предлагающий такие оригинальные подарки, которые не предложит ни один магазнин

    Posted 27 Dec 2008 at 5:11 am
  115. дeткa wrote:

    Круто, а продолжение будет?

    Posted 27 Dec 2008 at 11:23 pm
  116. priowinonoulky wrote:

    ubdsvbcoocrsqfdvwell, hi admin adn people nice forum indeed. how’s life? hope it’s introduce branch ;)

    Posted 28 Dec 2008 at 3:26 am
  117. Владимир wrote:

    Да уж… Все-таки интересное изобретение - блог. Казалось бы обычный сайт, но преобразили подачу информации, отдали сайт в руки толькоодного человека и открылась еще одна новая грань общения со всем миром. :)

    Posted 29 Dec 2008 at 3:09 am
  118. Станислав wrote:

    Точно, жизнь не может быть идеальной :)

    Posted 05 Jan 2009 at 8:20 am
  119. Марина wrote:

    Системы GPS навигации становятся все более и более востребоваными автомобилистами. … На помощь приходят GPS навигаторы. Существующие системы gps навигации в Омске

    Posted 05 Jan 2009 at 9:59 pm

Trackbacks & Pingbacks 7

  1. From WP Plugins DB » Plugin Details » Sticky Post on 06 Aug 2007 at 6:29 pm

    […] Visit […]

  2. From ENGRENAGEM - Media e Tecnologia: blog sobre jornalismo, citizen journalism, blogosfera e novas tecnologias on 14 Aug 2007 at 9:15 am

    […] dos artigos que forem introduzidos depois - conhe

  3. From wonder::beauty » WP featured post on 11 Sep 2007 at 5:34 pm

    […] sticky post plugin This entry was written by henry and posted on September 11, 2007 at 5:33 pm and filed under 网. Bookmark the permalink. Follow any comments here with the RSS feed for this post. Post a comment or leave a trackback: Trackback URL. « Snap shots tool […]

  4. From mfzqtakk on 31 Oct 2007 at 10:37 am

    mfzqtakk…

    mfzqtakk…

  5. From Sticky Post on WordPress - WP Text Ads Blog on 21 Mar 2008 at 8:13 am

    […] Sticky Post on WordPress - WP Text Ads Blog Uncategorized […]

  6. From » Willkommen! =) i DoT! on 08 Oct 2008 at 7:52 am

    […] Dieses stickied post wurde ermöglicht durch dieses feine Plugin) szu=’http%3A%2F%2Fwww.praxis-metzler.de%2Fidot%2F%3Fp%3D71′; […]

  7. From Оптимизируем главную страницу блога on 22 Oct 2008 at 4:30 pm

    […] 2) с помощью плагина Sticky Post. […]

Post a Comment

Your email is never published nor shared. Required fields are marked *