and like us on FB

In early October we provided a shortcode that would query Alpha Vantage for stock data. One of the comments asked about how one would include the data in tables rather than a graph. This is a very crude example (I spend no more than a couple of minutes modifying it). If you’re going to use it you’ll want to style it and copy the inline CSS to the appropriate location.

■ ■ ■

Shortcode of [stocktable number="10"] returns the following. It’s kind-of mobile responsive… so if you were to use it you would certainly need to make improvements. We’re caching the data for three hours.

9th January 12:00
C: 13.0800
O: 13.1800
H: 13.2200
L: 13.0800
V: 27849273
10th January 12:00
C: 13.0300
O: 13.0600
H: 13.1390
L: 12.9600
V: 56481303
11th January 12:00
C: 13.1600
O: 13.0200
H: 13.2000
L: 13.0000
V: 27392397
12th January 12:00
C: 13.2300
O: 13.1000
H: 13.2900
L: 13.1000
V: 56670361
16th January 12:00
C: 13.1000
O: 13.3100
H: 13.4800
L: 13.0100
V: 51999014
17th January 12:00
C: 12.1800
O: 12.5800
H: 12.5800
L: 12.1000
V: 130855595
18th January 12:00
C: 12.0700
O: 12.1800
H: 12.2000
L: 12.0200
V: 63714437
19th January 12:00
C: 12.0000
O: 12.1200
H: 12.1200
L: 11.9100
V: 50952518
22nd January 12:00
C: 12.0200
O: 12.0200
H: 12.0800
L: 11.9000
V: 52835368
23rd January 12:00
C: 11.9650
O: 12.0300
H: 12.0400
L: 11.9000
V: 34369071

Original post published here.

WordPress Shortcode

Copy and paste the WordPress function into your theme's functions.php file or, if you sensibly have one installed, your custom functions plugin.

If you require shortcode to work in a sidebar widget, you'll have to enable the functionality with a filter. If you're using our custom functions plugin, you'll have that feature enabled by default.

Shortt URL for this post: http://shor.tt/15eJ