Solvent

Edit (4/25/2006): I am officially discontinuing support for this plugin. I have a comment near the botom explaining further.

This is my first public WordPress Plugin. It’s sort of an “inverse” of Owen Winkler’s Adhesive plugin. Whereas Adhesive makes posts “sticky,” Solvent makes them “slippery,” so that they won’t be displayed on the front page of your blog, no matter how recently they have been written. To install, just unzip the file into your wp-content/plugins directory, and activate it from within your WordPress Admin control panel.

Solvent has only been tested with WordPress 1.5.1 (Strayhorn), so I have no idea if it works on earlier versions. I do know that it only works on versions where the is_home() function is defined, so I don’t think it will work on any version prior to 1.5 (or the 1.3 betas).

As with Adhesive, this plugin depends on your $posts array being somewhat pristine, so it probably won’t play nicely with any other plugin that modifies it. It has been tested and confirmed to work with Adhesive, however. The “Slippery” setting of Solvent always overrides the “Sticky” setting of Adhesive on the front page.

Right now, this is marked as a 0.5 version, since it has only been tested on one blog. Patches, enhancements and bug fixes are welcome – send them to [email protected].

Download:


Posted

in

by

Comments

20 responses to “Solvent”

  1. ColdForged Avatar

    Haven’t tried it, but nifty concept and definitely a delightfully pithy name :).

  2. c Avatar

    Spiffy! It’s worth noting that slippery posts still appear in one’s feeds — which only makes sense, but one might expect otherwise.

    I haven’t looked into how you’re accomplishing the slipperiness, but am I right that they’re still figured in to WP’s post-count? e.g. Mine is set to display 5 posts/page, but with a recent slippery post, the front page only displays 4 entries.

  3. Chad Avatar

    Yes, that’s true – that’s one of the reasons why this is only a “0.5” version. All it does is load the posts for the front page as normal, and then strip out the ones that are marked “slippery.” It’s a little different than the way Adhesive does it. Adhesive actually rewrites the database query to retrieve the posts. Solvent just works on the result set as is, in order to make it compatible with Adhesive. It will take some work to make it respect the posts per page setting. Making slippery posts fall out of feeds as well should just be a matter of adding an is_feed() test. Maybe I can get to those next week.

  4. Tom Avatar
    Tom

    This is great! thanks so much.

    A comment/suggestion.

    would be cool to see “Slippery: ” on the Manage->Posts page. similar to seeing “Sticky:”

    i think it would be a great function for a user.

    I’m planning on digging through the code, i’ll post any results if you want them.

    take it easy.
    tom

  5. The Uncooperative Blogger Avatar

    It works as advertised in wp 1.5.1.1! Thanks!

  6. hannah Avatar

    works wonderfully. thanks!

  7. elran Avatar

    thanks, i had no problems getting solvent 0.5 to work on WP 1.5.1.3 –

    i use it to display my “site news” in a seperate category, so that it doesn’t end up in between regular posts/articles on the main page.

    no apparent conflicts with any of the following plugins:

    adhesive.php
    blogtimes.php
    headmeta.php
    linkspage.php
    live-comment-preview.php
    rewrite-titles.php
    rssLinkList.php
    rust_autolinkoffs.php
    search_pages.php
    sitemap.php
    technoratitagging.php
    word_wrap.php
    wp-cc.php
    wp-style-switcher.php
    wp_jvisitors.php

  8. Neweol Avatar

    I’m using Solvent with 1.5.2 and it works great.
    However, I did a quick mod to get it to suit my purposes. I wanted the default to be that posts DON’T go on the front page. To do that, I edited the solvent.php is the following ways:

    changed (line 83):
    if (!in_array($post->ID, $slippers))
    to:
    if (in_array($post->ID, $slippers))

    changed (line 107):
    Slippery
    to:
    Front Page

    Might be useful to someone else out there…
    Thanks again for the great plugin.

  9. Kimiko the Furball Avatar

    Hello,

    I’ve been looking for a plugin like this for awhile and I thought it was going to work great. Sure, it does hide the posts from the front page. But it doesn’t “skip” the post, so if you enable the “slip” option on the last 10 posts and you only show 4 posts per page, you are going to get an error message saying that the search didn’t return any results (no stories).

  10. David Avatar

    I’m trying to get Solvent to work with RSS.. it’s just what I need.. however, adding an “is_feed” or clause doesn’t seem to help.. wp-rss2.php (for example) pulls the posts differently to the index page.. any ideas?

    – David

  11. Chad Avatar

    Neweol: what you really want, it seems, is the Adhesive hack on which this is based.

    Kimiko: I’m thinking about, in the next version, pulling twice as many posts as I need before running the weed-out routine, to minimize the effect.

    David: that stumps me for now, because using is_feed is exactly what I intended to do in the next version. I’ll try and take a look at it.

    Thanks for the comments!

  12. yuval Avatar
    yuval

    Using wp 1.5.2, I had to make the following change (diff format follows):

    99c99
    if(preg_match('|post.php|i', $_SERVER['SCRIPT_URL']) && $_REQUEST['action'] == 'edit')

    I am no WordPress/PHP programmer, but I hope this change is in place. It did it for me ๐Ÿ™‚

  13. yuval Avatar
    yuval

    Using wp 1.5.2, in line 99, I had to change SCRIPTNAME to SCRIPTURL.

  14. EnlaceZapatista Avatar

    Man, thanks! we love you!

    your plug-in save our live!!!

    it’s fantastic! it works perfect!

    thanks!

  15. Lance Brown Avatar

    Chad,

    I love this plugin, but it does appear that you are right in assuming it doesn’t work in WP 2.0. I don’t see the option on the post page anymore, and my attempts to add a custom field to make the post slippery were unsuccessful.

    Is there any chance you could point the way to how I can patch or fix Solvent for 2.0? I’m itchin’ to have it working again ASAP. It was quite the jolt to see that it wasn’t. ๐Ÿ™

    Any pointers you could give would be great.

  16. Garrett Avatar
    Garrett

    Hi Chad,
    I’ve upgraded to 2.0 and I still have the slippery option. The only problem is my mp3 link does not work when I choose it. If I leave slippery unmarked and the post hits the home page and the mp3 link works. Any idea what the problem is?
    Thanks, Garrett

  17. Vixx Avatar

    Hi. ๐Ÿ™‚

    Is there any word yet on a 2.0 version? I’m new to this plugin, but on installation I’ve had no extra option appear after activating it.

    I have my fingers crossed!

  18. Chad Avatar

    Due to a lack of time, and the fact that I’ve started using an alternate solution on the site I created this for, I’m officially “de-commissioning” the plugin. Anyone who wants to take the code and run with it for a 2.0-compliant version has my blessing. To those of you who have been waiting, my apologies. I really do hope someone comes up with a reasonable solution.

    For anyone who’s interested, my solution on the other site is to have a “Past Events” category which is omitted from the category list using Ryan Boren’s Front Page Categories plugin. Now when I want a post to disappear, I change its category, and voila!

  19. WindyWeather Avatar
    WindyWeather

    I too am using Solvent with WP 2.0.3,4 and I have not noticed issues with it. The reason that I use Solvent rather than Front Page Categories is that I, and my clients, want to post articles that show up in archives, via the category and other navigation, but not on the front page.
    Front Page Categories requires setting a special category and this category appears in the category list. Also there is some confusion about whether that “past events” category must be the only category for a post that is to be “slippery”. There are a number of reasons for tossing an article off the front page, and not all of them have to do with any particular category.
    Solvent is much cleaner, or articles are much cleaner when posted with Solvent, or something like that… ๐Ÿ˜‰

    Solvent Lives on.
    ww

  20. Chad Avatar

    I’m very glad to hear that it still works. I know it is now lacking some of the bells and whistles that other 2.0-compliant plugins have, but just the fact that it works is good news. I hope that someone eventually decides to take over maintenance of the plugin; I just don’t have the time or the will when I can scratch my itch another way.

    Thanks for the update!