SlideShare a Scribd company logo
Using JavaScript Libraries
like D3.js withWordPress
Presented By: John Cook
@johntylercook
WPtraining.tv
• Created by Brendan Eich in May 1995
• DynamicallyTyped
• Types are associated with values, not with variables
• Object Based
• Supports Dot Notation: object.y = 5
• Supports Bracket Notation: object['y'] = 5
• RunTime Evaluation
• Properties and values can be added, changed, or deleted at run-time.
JavaScript
Plugins Themes Content
Pros
• Can add to both site and
admin
• Works with most themes
• Can include in content with
shortcodes
• Extreme control
over where within
the theme the
library should be
used.
• Placed where you want
within post and page
content
• Easy to add/edit
• Works with most themes
Cons
• Requires programming
experience
• Requires
programming
experience
• More difficult to
include within page
content
• JavaScript libraries might
be included twice or not in
the proper way.
JavaScript and WordPress
•Use wp_enqueue_script() to add Scripts
•Use the Shortcode API to add shortcodes that can then
be used within post and page content.
JavaScript and WordPress Plugins
<?php
//To load a script that isn't already registered with WordPress
wp_enqueue_script( $handle, $source, $deps, $ver, $in_footer );
// Loading an example script
wp_enqueue_script('myscript', plugins_url( '/js/myscript.js', dirname(__FILE__) ) );
// Loading a pre-registered script
wp_enqueue_script('jquery');
?>
•Use wp_enqueue_script() to add script libraries
•Can create and add JavaScript code to a page
template.
•Can add JavaScript code to header.php or footer.php
and use:
• is_page_template()
• is_page()
JavaScript and WordPressThemes
1. Install a plugin for showing JavaScript/charts
and use the built in shortcodes.
2. Install a plugin for including scripts in the header
of the page and then go intoText mode to add
the chart code
JavaScript and Post Content
JavaScripting.com
•D3.js
•jQuery
•Three.js
JavaScript Libraries
JSPerf.com
https://wordpress.org/plugins/ipu-chart/
•Supports D3.js and SVG Charting
•Install the plugin and use the shortcode to add
charts to post and page content.
IPU-Chart
Questions?
Presented By: John Cook
@johntylercook
WPtraining.tv

More Related Content

PPTX
Building solutions with the SharePoint Framework - introduction
PDF
AEM Asset and Tag API
PDF
Instagram filters (8 24)
PPT
WordPress plugins
PPT
Drupal Bootcamp Mcn2008
PDF
Instagram filters (8 24)
PPTX
Welcome to the World of WordPress
Building solutions with the SharePoint Framework - introduction
AEM Asset and Tag API
Instagram filters (8 24)
WordPress plugins
Drupal Bootcamp Mcn2008
Instagram filters (8 24)
Welcome to the World of WordPress

What's hot (20)

PPT
Newspapers with WordPress
PDF
Upgrading to Drupal 8: Benefits and Gotchas
PPTX
[Webinar] Discover eZ platform v2.4
PPTX
TypeScript and Angular2 (Love at first sight)
PDF
ITT Flisol 2013
PDF
Get Involved with WordPress
PDF
WordPress Theme Reviewers Team
PDF
Joomla! multiplied - How to run Multi-Sites - JandBeyond 2014
PPTX
Kickstart android development with xamarin
PPTX
Porting ASP.NET applications to Windows Azure
PPTX
Getting Started with WordPress Plugin Development
PPTX
Developing Complex WordPress Sites without Fear of Failure (with MVC)
PDF
WordPress as a Service
PPTX
Maximizing WordPress
PPTX
Interoperability of components built with different frameworks
PDF
Asp.Net 3 5 Part 1
PPTX
Creating Custom HTML Helpers in ASP.NET MVC
PPTX
Better WordPress Theme Development Workflow
PDF
WordPress as a Headless CMS - Bronson Quick
PPTX
WebNetConf 2012 - Single Page Apps
Newspapers with WordPress
Upgrading to Drupal 8: Benefits and Gotchas
[Webinar] Discover eZ platform v2.4
TypeScript and Angular2 (Love at first sight)
ITT Flisol 2013
Get Involved with WordPress
WordPress Theme Reviewers Team
Joomla! multiplied - How to run Multi-Sites - JandBeyond 2014
Kickstart android development with xamarin
Porting ASP.NET applications to Windows Azure
Getting Started with WordPress Plugin Development
Developing Complex WordPress Sites without Fear of Failure (with MVC)
WordPress as a Service
Maximizing WordPress
Interoperability of components built with different frameworks
Asp.Net 3 5 Part 1
Creating Custom HTML Helpers in ASP.NET MVC
Better WordPress Theme Development Workflow
WordPress as a Headless CMS - Bronson Quick
WebNetConf 2012 - Single Page Apps
Ad

Viewers also liked (13)

PDF
RotationProposal_ShorrockM_D1
PPTX
Чем отличаются сиреневый, фиолетовый и пурпурный?
DOCX
Financial Structure Assignment
DOCX
resume word
PDF
Reese - Giles Resume
PDF
BabyCenterIndia Introduction
PDF
Proyecto de-vida.
PDF
ib-pulse-check-executive-summary
PDF
Bewust E-mailen: presentatie voor JONG! Valkenswaard
PDF
Vip Services e-Booklet-c2p
PDF
A Scalable Network Monitoring and Bandwidth Throttling System for Cloud Compu...
PPT
Salve annual PR report 2015 for NowWeMove and ISCA
PDF
ACB Company Profile
RotationProposal_ShorrockM_D1
Чем отличаются сиреневый, фиолетовый и пурпурный?
Financial Structure Assignment
resume word
Reese - Giles Resume
BabyCenterIndia Introduction
Proyecto de-vida.
ib-pulse-check-executive-summary
Bewust E-mailen: presentatie voor JONG! Valkenswaard
Vip Services e-Booklet-c2p
A Scalable Network Monitoring and Bandwidth Throttling System for Cloud Compu...
Salve annual PR report 2015 for NowWeMove and ISCA
ACB Company Profile
Ad

Similar to Using JavaScript Libraries like D3.js with WordPress (10)

PDF
WCLV13 JavaScript
PPT
jQuery Objects
PPTX
Object Oriented Programming In JavaScript
PPTX
Java Script - A New Look
PPTX
OOP and JavaScript
PDF
jQuery: The World's Most Popular JavaScript Library Comes to XPages
PDF
WEB MODULE 3.pdf
PPTX
jQuery - the world's most popular java script library comes to XPages
PDF
Make Your Own Charting Library with d3
WCLV13 JavaScript
jQuery Objects
Object Oriented Programming In JavaScript
Java Script - A New Look
OOP and JavaScript
jQuery: The World's Most Popular JavaScript Library Comes to XPages
WEB MODULE 3.pdf
jQuery - the world's most popular java script library comes to XPages
Make Your Own Charting Library with d3

Recently uploaded (20)

PDF
Electronic commerce courselecture one. Pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Machine learning based COVID-19 study performance prediction
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Approach and Philosophy of On baking technology
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Encapsulation theory and applications.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
sap open course for s4hana steps from ECC to s4
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Cloud computing and distributed systems.
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Electronic commerce courselecture one. Pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Machine learning based COVID-19 study performance prediction
Advanced methodologies resolving dimensionality complications for autism neur...
Building Integrated photovoltaic BIPV_UPV.pdf
Programs and apps: productivity, graphics, security and other tools
Approach and Philosophy of On baking technology
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Encapsulation theory and applications.pdf
NewMind AI Weekly Chronicles - August'25-Week II
The Rise and Fall of 3GPP – Time for a Sabbatical?
Per capita expenditure prediction using model stacking based on satellite ima...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Assigned Numbers - 2025 - Bluetooth® Document
sap open course for s4hana steps from ECC to s4
The AUB Centre for AI in Media Proposal.docx
Cloud computing and distributed systems.
Agricultural_Statistics_at_a_Glance_2022_0.pdf

Using JavaScript Libraries like D3.js with WordPress

  • 1. Using JavaScript Libraries like D3.js withWordPress Presented By: John Cook @johntylercook WPtraining.tv
  • 2. • Created by Brendan Eich in May 1995 • DynamicallyTyped • Types are associated with values, not with variables • Object Based • Supports Dot Notation: object.y = 5 • Supports Bracket Notation: object['y'] = 5 • RunTime Evaluation • Properties and values can be added, changed, or deleted at run-time. JavaScript
  • 3. Plugins Themes Content Pros • Can add to both site and admin • Works with most themes • Can include in content with shortcodes • Extreme control over where within the theme the library should be used. • Placed where you want within post and page content • Easy to add/edit • Works with most themes Cons • Requires programming experience • Requires programming experience • More difficult to include within page content • JavaScript libraries might be included twice or not in the proper way. JavaScript and WordPress
  • 4. •Use wp_enqueue_script() to add Scripts •Use the Shortcode API to add shortcodes that can then be used within post and page content. JavaScript and WordPress Plugins <?php //To load a script that isn't already registered with WordPress wp_enqueue_script( $handle, $source, $deps, $ver, $in_footer ); // Loading an example script wp_enqueue_script('myscript', plugins_url( '/js/myscript.js', dirname(__FILE__) ) ); // Loading a pre-registered script wp_enqueue_script('jquery'); ?>
  • 5. •Use wp_enqueue_script() to add script libraries •Can create and add JavaScript code to a page template. •Can add JavaScript code to header.php or footer.php and use: • is_page_template() • is_page() JavaScript and WordPressThemes
  • 6. 1. Install a plugin for showing JavaScript/charts and use the built in shortcodes. 2. Install a plugin for including scripts in the header of the page and then go intoText mode to add the chart code JavaScript and Post Content
  • 9. https://wordpress.org/plugins/ipu-chart/ •Supports D3.js and SVG Charting •Install the plugin and use the shortcode to add charts to post and page content. IPU-Chart
  • 10. Questions? Presented By: John Cook @johntylercook WPtraining.tv