Did you try putting it in a widget?
I would try a text widget and add this code to it.
<span style="color: #6C82B5; padding-right: 15px; font-style: italic;">
<script language="JavaScript">
showQuotation();
</script>
</span>
I am assuming you will have the script loaded in the js folder and a link to it in the header.
this is how you load JS:
add_action('init', 'load_myscripts');
function load_myscripts()
{
wp_register_script( 'my_script', 'http://www.patiastephens.com/quotes.js');
wp_enqueue_script('my_script');
}
forgot to tell you where to put that code…
either make your own plugin, or add it to the functions.php in the theme folder
Marjiec: I tried putting the script in the text box — also tried using the code you supplied (adding my script URL) — but it’s not showing up.
Mattdunlap: I found the functions.php file. Can you tell me where to insert that code?
Thanks!
Hey! You mentioned making my own plugin, so I researched it briefly but decided it was beyond my programming capabilities. However, it then occurred to me (duh) to search existing plugins, and there were several. I installed one called Stray Random Quotes that looks like it will do the trick.
Hooray!
If anybody is still paying attention to this topic, can you tell me why my quotes text is pushed over so far to the right?
http://patiastephens.com/wordpress/
I had a margin in the style sheet that I thought was causing it, but removing the margin didn’t help.
cowgrrrl, I just looked at your website and did an “inspect element” with Google Chrome’s javescript console and you have this as your margin
margin: 1em 40px;
the reason is that each browser has default settings for CSS. For example, blockquotes have a default indent, of 40px…
you need to set the blockquote to margin:0px in your stylesheet to override the default user agent stylesheet.
Never mind! I figured it out. I forgot that the template options include a blockquote style. By manipulating the margin and padding there, I’m getting it figured out.
I had removed the margin settings from all the stylesheets, but it wasn’t helping.
I didn’t know that about browsers having default blockquote indents! Good to know.