I finally had the chance to finish the sticky posts hack for WordPress. Quite simple actually. It lets a blogger indefinitely leave a post on top of their WordPress blog. Here is the link to detailed instructions to install the hack. Let me know if there are any bugs!
I really like this script, but I encountered a big cross-browser issue and I’m a complete newb at any coding other than flash =(
It works perfect in IE, but in Mozilla it seems to overlay the next post right over top of it.
http://oomsonline.com
I run wordpress 1.2
This is where I put the start and end lines for the loop, maybe that’s where I’m wrong.
to this, I would love to know!
Many Thanks,
Marius
Sorry, the pasted code got mangeled. You may edit that post, since it make no sense. If you know what I mean though, please let me know.
Thanks,
Marius
I played with the script a little bit for wordpress 1.2 and got it to work after changing one variable. I’m no coder, all I did is clean up the instructions a bit for wordpress 1.2. Here is the link for the instructions, Mark if you approve of these new instructions you can add them your site or do whatever with them.
Sticky Hack Instructions for WP1.2
I also clarified how I got the span tag to work for adding a sticky icon as you can see on one of my sections here:
OOMSonline
Again, I don’t know code very well, butI can hack and it works for 1.2 now after I had some cross browser issues and such.
Thanks,
Marius
Mark, just edit it as needed, your the creator of this beauty!
Thanks for a great hack! I tried Adhesive but it mussed up my posts. You is da bomb!! =) Astubeft! (Thanks!) =)
Well, no bugs yet….. except that the link doesn’t work…
TG
It should now, I was fixing what I thought was a bug. I also got locked out of my own entry in the WP forums “censored or edited by the admin” Weird!
Yeah…. no sooner did I comment about it being broken then it was fixed. ARGH. Too bad there isn’t a way to edit comments that you leave. Sigh. I think I’m going to give this a try here in a few. Looks straight forward.
TG
FYI: I got it up and running! Woo-Hoo! That is awesome.
TG
😛 Coolness!
Threaded comment reply
Mark,
Your instructions for implementing this hack are great! I’m going to try installing this today (after backing up files, first! LOL!)
I’m just wondering something…is there a way I can add some CSS styling to the sticky to make it distinctive? I guess what I’m asking is about the final rendered code on the page–is there a DIV called “sticky” or some such thing that I can pick out to apply CSS? Is this question making any sense?
Once again, thanks for sharing your talents and your coding with everyone.
Craig.
Let me look into that, I have thought of that as well…
Craig,
You could put something like this inside your inde.php where the b2motor starts(the loop):
<?php if ($post->post_status == ‘sticky’) echo ‘<span “sticky”>’; ?>
And put something like this just before b2motor ends (end of loop):
<?php if ($post->post_status == ‘sticky’) echo ‘<⁄span>’; ?>
This would wrap the entire sticky post in a div or span or whatever. I have used blockquote id = “sticky” in mine. Check out my blog when you get a chance. I done stole your blockquote css! 😛
Let me know if it works out well.
That’s exactly what I had been looking for. Thank you, thank you, thank you. I screwed it up at first (like usual) but after I put back all my old code, I gave it the old college try again and got it working.
Hi Mark,
Many thanks first of all for writing this hack.
I implemented your changes, but I am running 1.02, and had problems.
The post in wordpress worked fine, I created a sticky, and it stuck.
However when I went to edit any posted page (not even the sticky page) the edit page did not render correctly.
The footer, with the WordPress link appeared in the excerpt box. Weird? And none of the page showed.
I checked, and then re-checked my code and could not find a mistake, so I had to rollback the changes.
Any thoughts on what I should do to fix the edit page?
Many thanks
Muneeb.
You can check out my solution to WP Sticky Posts with an indepth tutorial at http://shaunandrews.com/2006/0.....cky-posts/