wordpress snippets last updated   : October 6, 2014
we now have 641 snippets
category shortcode

Google charts shortcode, lines, xyline, sparkline, meter, scatter, venn, pie, pie2d

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will create a new shortcode that takes advantage of the Google charts API. This shortcode will let you display a range of charts “lines, xyline, sparkline, meter, scatter, venn, pie, pie2d” See the below shortcode example of a 3D pie chart. Change the type attribute in your shortcode to specify the type of graph you wish to display.

read more

Print a list of all supported shortcodes

wordpress snippet

Adding this snippet to your wordpress template will display a list of every shortcode supported by wordpress and your wordpress theme.

read more

Display youtube video with embed shortcode

wordpress snippet

Adding this snippet to your wordpress theme will let you embed youtube video with a simple shortcode to your posts. Just add the youtube url to the video and your ready to go although you can specify a few paramaters like width, height, name, etc.

read more

Shortcode tables with multiple rows and columns

wordpress snippet

Have you have ever wanted to quickly and easily create a simple dataset table? Well adding this snippet to the functions.php of your wordpress theme to enable table shortcodes. Bellow you can see the example shortcode that you can add multiple rows and columns of data separating each row and column with a comma. Thanks to Jean Egan who noticed an issue with the old version.

read more

Add shortcode support to comments

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will enable shortcodes for comments. This code will first remove all shortcodes when it gets to comments and reinitialize only the shortcodes listed within init_common_shortcodes function. I have added in a simple sample shortcode that will grab the users website url and replace the [mysite] shortcode.

read more

Add Google doc’s shortcode for psd, ai, svg, and more

wordpress snippet

On Friday I posted a great snippet by Joen Asmussen the Google PDF shortcode. I wanted to post an updated version primarily because the Google online viewer supports many more file types not just PDF. The supported types are .DOC, .DOCX, .XLS, .XLSX, .PPT, .PPTX, .PDF, .PAGES, .AI, .PSD, .TIFF, .DXF, .SVG, .EPS, .PS, .TTF, .XPS I added a class attribute to the shortcode that you could use to display an icon for the file type link or style the links with the default icon class.

View sample PSD with Google viewer.

read more