I’m am trying to use the random witty text plug in. I have the plugin installed and activated. What is the text that I need to add to my templete in order for it to display the quotes? This is what I tried
< ?php witty(); ?>My search keeps leading me back to the dead end of downloading the plug in.
Any help is greatly appreciated.
<?php witty('<p class="witty">','</p>'); ?>
That’s what I have, with your css refelcting the style you want for the witty text.
Thanks for your reply. I see I had an inappropriate space in the text
<?php.... working now. Thanks again.
I see that the readme-first.txt file’s sample call to
wittyis missing a closing single quote after the
</p>tag. I think this is why I had trouble getting it to work, since I just cut and pasted.
<?php witty('<p class="witty">','</p>); ?>
One other thing: please mention in future versions of the
readmethat blank lines in the
witty.txtwill supply blank witty quotes: this made me think the plugin was broken until I refreshed.
Looks like a pretty cool plug-in. Too bad the install instructions are worthless.
I just have to pop in and say I use Witty as well, and I really, really like it. It could use more / better documentation, but it’s so simple it makes it a breeze once you get the hang of it. You can also use code on / within each line of Witty, which really leaves room for unique unusual things to be done.
Well, I can’t get the hang of it. I’m trying to run it in a specific spot on my right sidebar and all it’s outputting is an error code about witty () being unspecified. I only got that far by reading posts about it here.
Does it have to be in the index.php or am I breaking it by putting it in my right sidebar? If the sidebar placement is okay, can someone tell me exactly what code I’m supposed to be putting in, and if I have to edit anything else along with it?
To make it run, you can’t have it inside of a post. It has to be within one of the template files. I have mine in my sidebar at the very bottom. It works loverly.
Here is an example of my tag:
<li><?php _e('Thoughts'); ?>
<ul><li id="witty"><?php witty (); ?></li></ul></li>
The text file needs to be NOT in the plugin directory. It must be in the
wp-contentfolder. The text file can use html and each quote or use must be on its own line, but you can use
<br />for line breaks within the quote. Here are the first two of mine:
Wear a smile and have friends; wear a scowl and have wrinkles. What do we live for if not to make the world less difficult for each other?<br /><i>George Eliot</i>
Travel has a way of stretching the mind. The stretch comes not from travel's immediate rewards, the inevitable myriad new sights, smells and sounds, but with the experiencing firsthand how others do differently what we have believed to be the right and only way. <br /><i>-- RalphCrawshaw</i>
Hopefully that will work for you. Click on my name to see this in action on any of my articles.
I make use of mine in the header
<p id="witty"><?php witty(); ?></p>
and that’s the code that works for me.
I’m sure you could put it in the sidebar, you’d just have to follow your sidebars outline. ie.
<ul><li>PUT WITTY HERE</li></ul>
or something like that.
I copy/pasted your code directly into my sidebar.php file (even though I knew your “Thoughts” reference wouldn’t work).
Result: Fatal error: Call to undefined function: witty() in… and it points to the directory witty is in.
I have witty.txt in the wp-content folder, witty.php is in the plugins folder. I’m cool with formatting the actual quotes I want witty to use, but I can’t get witty itself to work. Does anyone have any idea what I’m doing wrong here?
It should work great. Make sure that your witty.txt is totally text with no quotes and not from a word processing file. I checked my notes and it worked for, as soon as I figured out what I described to you above, perfectly.
You might want to consider using another random file plugin. There are others out there. Maybe one of those will work for you.
Oops, correction, the fatal error is pointing to the template file I pasted the witty reference into.
Where is your Witty.txt file located? Do you have it in the plugins folder?
- The topic ‘Make me Witty’ is closed to new replies.