WordPress.org

Ready to get started?Download WordPress

Forums

Sticky Post Hack - 0.72 (50 posts)

  1. Cena
    Member
    Posted 10 years ago #

    LL, is all that's required to update it to 1.0 is changing filenames? (b2->wp, etc) I'd like to try it out but I'm using the latest CVS, which is 1.0 pre-alpha, woohoo! :)

  2. Laughinglizard
    Member
    Posted 10 years ago #

    The hack will need a little retooling and testing for 1.0 in addition to the changed filenames. The database selection structure for the main blog is a little different along with the post_status selection under the post edit page. The changes are in the sql that selects the posts (because post and edit use different pages now) and also in the way the radio buttons choose the post_status. I am sure this structure is going to change a bit before it hits a full release.
    BTW the new pre-alpha CVS looks really nice and has a lot of really nice new features! Good job Matt, Alex, Dougal, Mike and others!

  3. Lester Chan
    Member
    Posted 10 years ago #

    @LaughingLizard =D Good Job.

  4. Laughinglizard
    Member
    Posted 10 years ago #

    Thanks GamerZ!

  5. jackiefg
    Member
    Posted 10 years ago #

    I changed my db and used the sticky post, everything works just great.
    What I'm wondering though, is there a way for it to NOT show the date at the top of the post? I just want to leave a message at the top that people can comment in about where they're from, but I'd prefer if it didn't have the date on it because that's the first thing they see. Then they'll think that there's an old post there.
    Anyway to stop the date from just one post?

  6. Laughinglizard
    Member
    Posted 10 years ago #

    Sure,
    Find this line (or an equivalent) in your index.php:
    <?php the_date('','<h2>','</h2>'); ?>
    and replace with these lines:
    <?php if ($post->post_status != 'sticky') the_date('','<h2>','</h2>'); ?>
    Hope it helps.
    Peace

  7. jackiefg
    Member
    Posted 10 years ago #

    You are a genius :) That works perfectly.

  8. Laughinglizard
    Member
    Posted 10 years ago #

    Thanks Jackie....I only wish!!

  9. Laughinglizard
    Member
    Posted 10 years ago #

    The sticky post hack now has the extra information needed to work in 1.0. Please let me know if there are any bugs.
    Peace

  10. Anonymous
    Unregistered
    Posted 10 years ago #

    LaughingLizard, I installed this great hack on 1.0 with no problems. Maybe you should make it clear in Step 1 that the first "==FIND==" is for 0.72 only, and not 1.0
    Thanks for the hack!

  11. Laughinglizard
    Member
    Posted 10 years ago #

    Fixed. :-) Thanks for the heads up

  12. be4dean
    Member
    Posted 10 years ago #

    LaughingLizard, installed the hack on 1.0, everything looked ok - the 'make sticky' link shows up - then did some test posts as both superuser and tester (+1), and the supposed-to-be-sticky post slips right doen the page. any ideas why? thanks.

  13. Laughinglizard
    Member
    Posted 10 years ago #

    Two things to check. If it does slip down, make sure you followed the instructions to put some extra information in your wp-blog-header.php (I am assuming you are using 1.0) If you did do it right, go into phpMyAdmin or its equivalent and see what post_status that entry is in. I have noticed that some posts will not get their post_staus changed until you edit (a bug onm y part probably) Email me if you still cannot make it work.
    Peace

  14. be4dean
    Member
    Posted 10 years ago #

    thanks laughinglizard (can i call you ll?) - i made it sticky via phpMyAdmin - do i now need to make some change in wp-blog-header.php so i won't need to continue doing such in phpMyAdmin? and while we're on the subject, can the 'make sticky' feature be made exclusive to superuser? i'm setting up a community blog, so i don't want all +1s trying to 'one-up' one another!

  15. Laughinglizard
    Member
    Posted 10 years ago #

    The instruction should tell you how to modify wp-blog-header.php
    As for the user level thing, it would take a little more code. Email me over the next couple of days and I will see what I can whip up. (might take me a while, school starts tomorrow!)

  16. Anonymous
    Unregistered
    Posted 10 years ago #

    My sticky post doesn’t work like it should. It’s ’sticks’ on top of the page when I pull up the category it is in. Also it ’sticks’ on top of the page when I pull up the month of January archives. But not on my main page. http://dark.unitz.ca/~stduval/blog/index.php I am using V 0.72 and went over LL's detailed instructions like a thousand times. Help me please. I am at a loss.

  17. stduval
    Member
    Posted 10 years ago #

    The above post is me... I decided to register.

  18. Laughinglizard
    Member
    Posted 10 years ago #

    I see that you are using 0.72. My best suggestion would be to remove all of the hack and start over again. I cannot look at your code, but your error lies in your blog.header.php. I would look at that real close and check to make sure all the curly brackets close in the right place, etc. Unless you have made any serious changes to your blog.header.php, I would start with a fresh copy and re-apply the hack to it.
    Hope this Helps.
    Peace

  19. stduval
    Member
    Posted 10 years ago #

    No luck! :-( Maybe I can send you the file so you can look at the code? Pretty please? lol. Just kidding. I will just remove the sticky tag option for now until I grasp a better understanding of PHP. Already in the last month I have picked up some. So maybe by next month I will be able to determine the problem. Thanks LL.

  20. Laughinglizard
    Member
    Posted 10 years ago #

    Sure thing! Would love to help you out as much as I can.

  21. goborobo
    Member
    Posted 10 years ago #

    There are two contradictory assertions at the beginning of this thread. Read about them in this thread .
    Which statement is correct?

  22. TechGnome
    Moderator
    Posted 10 years ago #

    OK, I must be blind because I don't see any contradictions going on.
    BTW: the link in the above post broke on me. I think this should be the right link here: http://wordpress.org/support/index.php?action=vthread&forum=3&topic=2811&page=0&anchor=5%22
    TG

  23. goborobo
    Member
    Posted 10 years ago #

    OK, maybe these are not contradictory statements but they have confused me so perhaps you can explain:
    The first post in this thread states "It lets a blogger indefinitely leave a post on top of their WordPress blog"
    The next post states: "a sticky will stick on top of a current day only."
    current day or indefinitely?

  24. Laughinglizard
    Member
    Posted 10 years ago #

    "It lets a blogger indefinitely leave a post on top of their WordPress blog"
    ... is correct. If it does not behave this way, there is a bug which needs to be fixed. Post bugs on here or through email.

  25. Laughinglizard
    Member
    Posted 10 years ago #

    @nexia: point well taken, but no promises on when that will be available. I will, however, see what breaks it in 1.1

  26. Anonymous
    Unregistered
    Posted 10 years ago #

    LL,
    in your instructions you put:
    <i>Consequently, here is the php code to run from a webpage, if thats your cup of tea.</i>
    $sql = 'ALTER TABLE b2posts CHANGE post_status post_status ENUM( \'publish\', \'draft\', \'private\', \'sticky\' ) DEFAULT \'publish\' NOT NULL ';
    for a third option.
    since i don't have the first 2, could you give me instructions on how to do this? i have no idea at all about mysql.
    thanks

  27. Andy91fr
    Member
    Posted 10 years ago #

    Hi all,
    I'm having the same problem as nexia, my sticky posts are lost to view. Had a look in PHPmyAdmin (2.5.5-pl1) and the "sticky" status doesn't show in the wp-posts table. If I try to modify it in by hand or import a text file as described above but replacing "b2posts" by "wp-posts", I get this error message :
    ALTER TABLE wp_posts CHANGE post_status post_status ENUM( 'publish', 'draft', 'private', 'sticky', ) DEFAULT 'publish' NOT NULL
    MySQL a répondu:
    #1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ') DEFAULT 'publish' NOT NULL' at line 1
    I've had a look at the doc but I'm afraid I'm too much of a newbie to figure this one out. If anyone can help?
    This is the version n° : MySQL 4.0.16-standard
    Thanks.

  28. Laughinglizard
    Member
    Posted 10 years ago #

    @Andy91fr, Anon and nexia: There will be a new version of this hack soon (maybe sometime this week) But till then, try this MySql query:
    ALTER TABLE $tableposts CHANGE post_status post_status ENUM( 'publish', 'draft', 'private', 'sticky' ) DEFAULT 'publish' NOT NULL;
    Where $tableposts is the name of your posts table (wp-posts in Andy's case) I believe Andy's query is missing the ending ';'

  29. Andy91fr
    Member
    Posted 10 years ago #

    Thanks a lot, LaughingLizard, but I still get the same error message. Guess it'll wait for the new hack.

  30. Cine
    Member
    Posted 10 years ago #

    The status keeps changing itself back to "Publish" :( It only works when I change the status manually through phpmyadmin. I use 1.0

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags