Welcome to Dagon Design. In addition to free scripts, WordPress plugins, and articles, we offer a variety of services including custom theme design, plugin creation, and PHP scripting. Contact me for more information.

Version 1.0   Updated Sunday, March 22nd, 2009 at 8:20pm

Stock Quotes Plugin for WordPress

This WordPress plugin allows you to easily display stock quotes on your website. The output of the plugin is designed to be minimal – the stock symbol, last price, and change amount are shown. You can configure the output in the options page for the plugin. The data is retrieved from Yahoo finance.

Download

  If you have found this page useful, please consider donating. Thanks!

Instructions

  • Download the above file, rename it from .txt to .php, and upload it to your plugins directory
  • Enable the plugin
  • Configure the plugin options (under DDStockQuotes)

Demo

MSFT 44.40 [-0.47]
GOOG 593.35 [-2.63]

Change Log

  • 03-22-09 Version 1.0 – First release

Usage

There are two ways this plugin can be used:

In a post or page:
[stock SYMBOL]

From a template file:
<?php echo ddsq_get_quote('SYMBOL'); ?>

* where SYMBOL is the stock symbol you want to use

Important note regarding symbols

For most stocks, you can simply use the standard symbol, but for some cases (such as indexes) you will have to use the proper tags from Yahoo Finance. First, use this URL to search for your stock/index/etc..

http://finance.yahoo.com/

Then when the results are shown, look at the URL. For example, searching for the Dow Jones Industrial Average. From the ’s’ parameter in the URL, and the symbol shown next to the name, you will see that it uses ^DJI. For the S&P 500, the tag is ^GSPC.

Options

Here are the options available in this plugin’s options page in the WordPress admin panel.

Output Format

This is the format of the plugin output. You can use any HTML you want, using the placeholders for the values: %NAME% %LAST% %CHANGE%

Example: <strong>%NAME%</strong> %LAST% [<strong>%CHANGE%</strong>]

Up Color

Color to use for price change when up (leave blank to disable)

Down Color

Color to use for price change when down (leave blank to disable)

Non-WordPress usage of the code

If you would like to use this script in your own PHP code, outside of WordPress, it is easy to do. All you need is the ddsq_get_quote function from the plugin, replacing the three lines at the start of the function (which pull the option settings from WordPress), with the actual option strings. Example:

$quote_format = '<strong>%NAME%</strong> %LAST% [<strong>%CHANGE%</strong>]';
$up_color = '00BB00';
$down_color = 'FF0000';

Pages: [6] 5 4 3 2 1 » Show All

  1. This paragraph is really a good one it assists new the web users,
    who are wishing in favor of blogging.

    my web page :: free ebook, Kaitlyn,

  2. having an issue with a script, please make sure you have read the entire article. Also

  3. having an issue with a script, please make sure you have read the entire article. Also, please read through the comments because most common issues have already been discussed many times. Th

  4. all of these articles are the same, there is nothing I have not come across in the past year that is any news to us.seems like everyone has run out of proper ideas

  5. Hi, I am using the plugin but I keep getting MISSING SYMBOLS LIST. [] error when trying to add the Dow Jones Industrial (^DJI). Any help would be appreciated.

  6. Hello, I desire to subscribe for this website to obtain hottest updates,
    so where can i do it please help.

  7. you have awesome post, i like it plugins and really need to be good

  8. I think is that beats By Dr Dre Heartbeats By Lady GagaSince the alpha of helmets.

  9. Its an amazing Tragedy But what it happens i like it plugins and really need to be good really Nice thanks Visit My site For more info

    Regards :- Juliet Bocala

  10. Nice things and plugins these are more important things

    Regards :- Dagmar Bluekens

  11. If you found this widget while searching for a plugin/widget that allows users to pull stock quotes you will find this widget useful. http://homeofdrock.com/2013/02/21/wordpress-stock-quote-widget/

  12. does not affect accepted appearance, feel affected and awash with personality.Beats By Dr Dre Heartbeats By Lady GagaSince the alpha of helmets by dre beats headphones Usher bound copy

Pages: [6] 5 4 3 2 1 » Show All

Leave a Comment

Before you comment: If you are having an issue with a script, please make sure you have read the entire article. Also, please read through the comments because most common issues have already been discussed many times. Thanks.


Be sure to wrap all code in <code></code> tags.