Support » Plugins and Hacks » Adhesive: A new sticky WP plugin

Adhesive: A new sticky WP plugin

  • This thing was kind of a proof of concept for something else I was doing, but it seems to work well enough to release.
    Adhesive is a WordPress plugin that lets you easily mark posts as sticky. Adhesive is different than other plugins I’ve found with similar functionality for two reasons:

    1. You don’t need to modify any WordPress code.
    2. You need only check a box when you want to make something sticky.

    Other stuff that you might want to know: Adhesive uses post meta fields to store its sticky status. Sticky posts only appear in the categories that they’ve been assigned to. If you’ve modified your index.php heavily (fetching the $posts array in a different way than the default), then this plugin may not work for you. Adhesive should maintain the posts_per_page setting in your options – I’m not sure whether other sticky plugins do this.
    The upside is that if if doesn’t do what you want, you can just deactivate it and delete it. 🙂
    To install Adhesive, drop the file in your plugins directory and activate it on the Plugins tab. That’s it!

Viewing 15 replies - 61 through 75 (of 149 total)
  • Hey RM, just trying this thing out.
    It seems to work great. One question though. Is there a way to sort the stickies into a specific order? I understand if you don’t have time to impliment that, but even if I could just go into the database and alter something. I’ve tried altering the ID of the post and that didn’t work; changing the dates of the posts didn’t work. I’m sure there’s a simple way.
    Thanks in advance.

    Nevermind, I got it.
    The order of the sticky posts is determined by the order in which you made the posts sticky. The last post that you made sticky will be at the top, and so on reverse-respectively all the way to the first post that you made sticky. Makes sense.

    I have checked with my host and they tell me that temp. tables are enabled on MySQL. Any other ideas where this error would be coming from?
    Database error: [Access denied for user: ‘ptuttle@64.202.167.%’ to database ‘ptuttle’]
    CREATE TEMPORARY TABLE Adhesive SELECT * FROM wp_posts INNER JOIN wp_postmeta ON wp_posts.ID = wp_postmeta.Post_ID WHERE meta_key = ‘sticky’ AND meta_value = ‘1’;

    If I understood the original post correct, posts marked with sticky should only show up in the selected categories. In my case however, sticky posts show up in their assigned category AND on the front page. Am I missing something? Do I need to modify the code in index.php?

    Hope you are still in the Adhesive business! 🙂
    Is it possible to set Adhesive stickies to appear ONLY on the front page, and NOT as Stickies in the categories OR listings-by-date? Please advise, thanks.

    You should try to execute that query in phpMyAdmin and see if it runs. I’m going to bet that it does not. The only things I can think of are that you don’t have create temporary (this is different than simply “create”) permissions on your database, or that you don’t have permission to access the database with that user at all (which isn’t likely if WP is working otherwise).
    The tricky part is if it would normally appear on the main page when you post it, then it will be sticky on the main page, too. It will be sticky on whatever page it would appear if it was a regular post.
    You’d have to add a few things to the source. You’d need to detect if those pages (category or date) were requested, and skip the sticky stuff if they were.
    Looking at my source (which isn’t necessarily the same as yours), I see a line near the top of the function adhesive_head() that reads:
    if($single || isset($_REQUEST['m'])) return;
    Presumably, that would prevent Adhesive from applying to some date archives. (I’ve not tested this, since I don’t use sticky posts at all. Crazy, huh?) If you add additional criteria to that statement, you can prevent Adhesive from working on other pages. So, like…
    if($single || isset($_REQUEST['m']) || $cat='all' || empty($cat)) return;
    …might get you what you want (completely untested, mind you).

    Here is the error I get when trying to run this in phpMyadmin:
    syntax to use near ‘* > posts} INNER JOIN {$wpdb * > postmeta} ON {$wpdb * > po
    The only thing I notice is that the ‘->’ turn into ‘* >’ when I try to execute it. Anyone else see a syntax error? Hmmm.

    I’d like to use this plugin, as I find it useful. However, I’m running WP 1.3A2 and, although it is activated, it doesn’t show up at all.
    No error messages (that I can see, at least) either.
    Any ideas?

    I don’t seem to have any code quite like you mentioned above. I am using adhesice v1.5.

    Help! I’m using the Adhesive plugin and everything was going swimmingly until I realised that whenever I do a search on my site, the sticky posts stay at the top, regardless of whether they have that search word in them at all. Any advice? I’d really like to keep this plugin…

    Oh, and I’m using version 1.5….. Any help would be really appreciated,

    Ringmaster – you’re a star. It works perfectly. Thanks for the code, and for the stickies!

    Ringmaster – I spoke to soon. My stickies are no longer sticky. I used the code you suggested and it seemed to work ok, but now the stickies are no longer on top. Any more ideas? Thanks

    howdy…where exactly is the class=”adhesive_post” inserted? I’ve modified my Loop script a bunch, which is likely why I don’t see the class anywhere, but if I can know where it’s *supposed* to go, maybe I can figure something out. Thanks!

    @guacamole queen:
    Well, if it has stopped entirely, then you may have mistyped something. Be sure that there are double bars (||) between each element in that statement, just as I have it.
    The “adhesive_post” classname is added to the sticky post via javascript when the sticky post appears. All you should need to do is add the appropriate styles to your stylesheet for that classname, and it should work.

Viewing 15 replies - 61 through 75 (of 149 total)
  • The topic ‘Adhesive: A new sticky WP plugin’ is closed to new replies.