Sticky Posts Hack

published in 2004, on May 21 at 7:06 AM and tagged with:

As you can see above, I've created a Sticky Posts Hack for WP. It involves three steps:

  • Download sticky.phps and save it in you WP root directory as sticky.php
  • Create a category called "Sticky"
  • add the following to your index.php < ?php if (empty($_GET) ) { include('sticky.php'); } ?> for it to appear only on the main page or < ?php include('sticky.php'); ?> if you want it on all pages.

Now the most recent post that you've put in the category "sticky" will stay at the top of your blog.

6 Comments

On 2004, on May 21 at 7:14 AM chris veltman said:

very nice. thanx for this hack. chris

Link to this comment
On 2004, on May 21 at 7:15 AM Eric said:

I'm not clear on WHERE to insert the ?php if (empty($_GET) ) { include('sticky.php'); } ?> code in my index.php file. Where does it go?

Link to this comment
On 2004, on May 21 at 7:15 AM Sean said:

the "include sticky" code goes wherever you wish it to appear on your page, outside the "wordpress loop"
Hope that helps.

Link to this comment
On 2004, on May 21 at 7:16 AM Goldfish said:

How can you hide the "sticky" topic on the main page?

Link to this comment
On 2004, on May 21 at 7:16 AM Sean said:

Instructions for hiding a category can be found here:
http://wordpress.org/support/5/5687#post-17

Link to this comment
On 2004, on May 21 at 7:17 AM sueytopia » Testing Sticky Post said:

[...] ing Sticky Post Filed under: sticky — suey @ 12:35 pm 12:35 pm this version (from http://blog.morydd.net/index.php?p=148) just uses “sticky” as a category and a simple change to the index.php to insert this line of code [...]

Link to this comment

Leave the next comment!

« New Name &bull A Good Cause»