Wordspinner – Free Word Spinner Plugin for Wordpress
- August 15th, 2008
- Posted in General
- Write comment
I got a couple of emails about my last article about the free spinner code, and have made a rather spiffy plugin for WordPress that will do the same thing on any posts or pages on the site.
You can grab it here: WordSpinner Plugin for Wordpress 2.6.0 (and up)
There is an example of what it does in this page. Hit refresh on your browser and see if you can tell!
See the included readme file for changelog and useage (it’s easy as pie).
UPDATE 26th Aug 2009: Just upgraded it to be compatible with 2.8.6
To have the spinner work for Text Widgets you need to manually edit line 611 of wp-includes/widgets.php so that instead of “echo $text;” it says “echo run_spinner($text);”
I just did that and now I can cycle affiliate ads that only take a text-widget to add or change. Woo!
I really like your plugin, but have most of my content in custom fields, would it be hard to make it work with custom fields?
If it’s in custom fields, you’re probably calling them in the template somewhere, right? Use the same kind of logic as in the comment about text widgets and replace the bit in your template that outputs the custom field data with a function call to “run_spinner($whatever-the-variable-is-to-output-your-data)”. Does that make sense?
e.g. to output a spun version of all the custom fields, use this in your template:
echo run_spinner(the_meta());yes got it working a treat, the only problem I had it would not spin with the seperator as a tilda? I had a older plugin that wont work with the new version of wordpress, I’ve just imported all those older stories into my new blog.
Any quick way of changing the ~ to a comma?
Actually I used mysql to search and replace, thank’s once again this plugin is great!
I love the idea of a built-in word spinner sitting right on my blog. But I’m having trouble with it for now. I am using this format to separate words { | }.
But I get this message: Warning: split() [function.split]: REG_EMPTY in (my domain stuff here)……/plugins/wordspinner/wordspinner.php on line 120.
Any chance you would tell me what this means? I would appreciate it very much. Thanks
Glad you got that sorted weareunderscore, thanks!
Stanly, the reason that isnt working is because the pipe is a special character in regex and php, try using something else to separate the words (you can also do a mysql find and replace like weareunderscore did to fix all your posts at once)
- K
I installed your word spinner but for some reason it mucked up the short codes on my site. The short codes appeared on the web pages. Do you know what is happening here?
@Nik: Is it version 1.3 or 1.4? There was a bug in 1.3 that potentially overwrote Text widgets, and now there are completely separate widgets for Spinable text widgets, so you may have to copy/paste things from text widgets into one of the new Spinning text widgets.
Other than that all I can think of is that maybe the code you’re inserting contains reserved characters
Hi Kythin, Thanks for this great contribution.
I want the spinner to run once for each of post and not to change every time page loads. Is that possible ?
I am not good with PHP and prefer not to mess it up.
Thanks-
@matias Probably, but it contradicts the point of my plugin a bit. The way to do it (if you have a php coder friend) would be to look up the wordpress API and find out what hook runs when an author saves the page, and then wrap that in a spin function call. The problem then is that you would lose all your other options in each set of brackets so you wouldn’t be able to re-edit the page in the same way, which brings it back to defeating the point of the plugin…
what you could also do, is use this page (or download the code and make the textbox much bigger for longer articles) whenever you want a new article spun once, then copy/paste it into your site;
http://www.kythin.com/misc/spin.php
I MAY add something like this to the options pane in a future update, just so it’s a bit less fussing around, but I’m pretty busy at the moment sorry!
Kythin,
I must say that I am impressed. Simple, clean and very easy to implement. Kudos to you.
I have to ask, why did you use “[,]” instead of using the so called standard of “{~}” or the “|” characters?
And finally, is there a problem changing those three characters within the code? I see where I can change them I just thought I would ask so as to avoid any problems that you may have had.
Thanks again!
Buddy
@siteblaster Thanks for the kudos! You can change the characters you want to use in the options in the WP admin, The pipe probably won’t work unless you escape it properly, the braces I think should be fine.
Kythin,
Thanks for your previous response. I am trying to use this in my footer in a Text: Links widget but it is not working. I am using WP v2.9 so the previous usage instruction does not appear to work as altering line #611.
So is there a way that it can be used in a more direct way? Like
echo run_spinner([Keyword Phrase 1,Keyword Phrase 2,Keyword Phrase 3]);
Thanks!
@siteblaster
You should be able to do something like:
$somestr = “[Phrase 1,Phrase 2,Phrase 3]“;
echo run_spinner($somestring);
It will still use whatever characters you have set in your WP options as the end and separation characters though, so make sure they’re the same.
Kythin,
Thanks for your time. If you would look at http://buddyshearer.com/ and then look at the Footer you will see what I am trying to do. Its as if the code is not being processed.
Hey Kythin!
I got it working! Never mind and thanks for your plugin.
Hey Kythin,
I am having an issue with a couple of my seasoned plugins not working correctly (I missed them before). I was doing some spinning within some plugin’s CSS and HTML code. Works great in that capacity.
However, a couple of my plugins use short-codes which look like this {someshort-code]. It appears that WordSpinner actually tries to process this and thus that plugin fails.
I tried changing the WordSpinners delimiter but I have been met with error codes when I try spinning with them. I tried ” { , } ” as well as ” { | } “.
How would you change them to use a different escape sequence?
Would is work by just using dual brackets like [[phrase#1,phrase#2,phrase#3]] ?
Thanks for your time.
@siteblaster: In theory that would work, if you set WordSpinner to use double brackets it should stop messing with your other shortcodes.
They could be anything, actually. They dont have to be the same character, and they dont have to be brackets, e.g. it could be set to use %$some*words*to*spin$% for all it cares. (untested, but should work!)