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.


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


  • 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)


MSFT 40.01 [-0.39]
GOOG 536.10 [-20.44]

Change Log

  • 03-22-09 Version 1.0 – First release


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..


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.


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. you have awesome post, i like it plugins and really need to be good

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

  3. 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

  4. Nice things and plugins these are more important things

    Regards :- Dagmar Bluekens

  5. 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/

  6. 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.