SlideShare a Scribd company logo
1 of 51
Download to read offline
#wcyyc @tammalee
TAMMY VALGARDSON
@tammalee @kickpointinc
Development Director
Figure-outer of things
Code snippets in this talk are here:
https://gist.github.com/tammalee
I have attributed sources where I can!
But some sources are lost in the mists of time. Sorry.
#wcyyc @tammalee
Pocket Full of Pro-tips*
Tammy Valgardson
* A dry technical talk livened up by gnomes and rainbows!
#wcyyc @tammalee
The Big Picture
#wcyyc @tammalee
You, a developer, are
not alone, anymore.*
* Unless you're a freelancer. Sorry. You
might be alone. :(
#wcyyc @tammalee
Big Picture Considerations
UX/Design
● Component behaviour (animations,
transitions, responsiveness)
● Micro-copy (Those teeny messages
that frustrate users)
● Performance (How many fonts are
we loading? D:)
● Established web conventions
reminders
Digital Marketing
● URL structure
● URL STRUCTURE
● UUUURRRRLL… you get the picture
● Relevant markup
● Schema
● Little things like, 'external links must
open in a new tab'
● GTM/GA implementation
● Client goals and other things that are
good to know at the beginning of a build!
#wcyyc @tammalee
Big Picture Protips
How to save yourself time and hours down the road.
● Know the finished site structure and URLs
● Know what is going to be tracked with what
marketing tool
● Don't assume anything about the design & get the
final content early
● Make sure all utility pages have been touched on
(e.g. 404 page)
#wcyyc @tammalee
You are still the
expert when it comes
to building things!
#wcyyc @tammalee
Digital Marketing Stuff
#wcyyc @tammalee
Google Analytics
1. Use the wp_head action to insert the code snippet into your header
via the functions.php file
2. Copy and paste the code snippet directly into your header.php file
DO NOT Install a plugin JUST to insert GA code!
(I will talk so much smack about you if you do)
Gnarr!
#wcyyc @tammalee
Go one better, and install
Google Tag Manager
instead of just
Google Analytics
#wcyyc @tammalee
What is GTM? (Google Tag Manager)
GTM is is a free tool that makes it
easy for marketers to add and
update website tags -- including
conversion tracking, site analytics,
remarketing, and more—with just a
few clicks, and without needing to
edit your website code.
I like it because it means less people
need to touch the code!
Touch mah
code and I
cut U!
j/k
#wcyyc @tammalee
GTM Templates
Instead of starting from scratch every
time you create a GTM container for a new
site, create a template you can export and
import into the new container!
Click on your template container then go
to Admin. You’ll see Export Container and
Import Container links.
#wcyyc @tammalee
Installing Google Tag Manager
You'll be given two code snippets. One goes
between the <head></head> tags in your
header.php file and the other goes right after
the opening <body> tag in your header.php file.
Because the snippets are split, and WordPress
doesn’t have a native ‘after_body()’ hook, I
usually just edit my header.php file. Then I feel
dirty there wasn’t a better way. (A PLUGIN IS
NOT A BETTER WAY!)
#wcyyc @tammalee
www.simoahava.com
#wcyyc @tammalee
GTM - Welcome to the data layer
Most of the time, it's pretty straightforward to create
GTM tags. But when it comes to tracking form events,
things seem to fall apart. I blame AJAX.
Sometimes, to track a form or eCommerce interaction
properly you need to use the GTM data layer.
The data layer is a JavaScript array that needs to be on
your site, which is why a developer needs to be involved.
#wcyyc @tammalee
Data layer push using Mailchimp 4 WordPress
● Create a GTM variable called formId
● Create a GTM trigger
● Create a GTM tag
● Add data layer code on your site that will
send a variable called ‘formId’ to GTM
● Celebrate when you start seeing results!
Let’s break it down a bit further.
#wcyyc @tammalee
Create a GTM variable called formId
#wcyyc @tammalee
Create a GTM trigger
#wcyyc @tammalee
Create a GTM tag
#wcyyc @tammalee
#wcyyc @tammalee
GTM - Gravity Forms
Same steps as before,
but this time we are
using a PHP hook
instead of a JS one.
And what if you want
to pass over the value
of a drop down field?
#wcyyc @tammalee
GTM - Gravity Forms
In addition to the formId
variable, you’ll need to create
a variable for the new value
we’re passing.
#wcyyc @tammalee
GTM - Gravity Forms
My Trigger was the same as
last time, formId but now I
can use my new data layer
variable as a label in my tag!
#wcyyc @tammalee
#wcyyc @tammalee
ADVANCED CUSTOM FIELDS
#wcyyc @tammalee
#wcyyc @tammalee
ACF Local JSON
“Local JSON is a new feature added in version 5
which saves field group and field settings to files
within your theme. The idea is similar to caching
and both dramatically speeds up ACF and allows for
version control over your field settings!”
https://www.advancedcustomfields.com/resources/local-json/
Vroom vroom! Let’s speed up ACF!
#wcyyc @tammalee
ACF Local JSON
● Go to your theme folder
● Create a new folder called acf-json
● Go to the Custom Fields area of your WordPress
admin and save each of your custom fields to
generate JSON files
● Performance
Seriously, that’s all there is to it!
So, what did that do?
#wcyyc @tammalee
We went from this:
ACF Local JSON
To this (on a locally hosted site):
[Page generation time / Peak memory usage / DB query time / DB queries]
#wcyyc @tammalee
Query Monitor
“Query Monitor is a debugging plugin for anyone
developing with WordPress. It has some advanced features
not available in other debugging plugins, including
debugging of AJAX calls, REST API requests, redirects, and
the ability to narrow down its output by plugin or theme.”
https://en-ca.wordpress.org/plugins/query-monitor/
This plugin is great!
It’s how I test performance while developing.
#wcyyc @tammalee
acf_the_content()
WP has the_content() ACF has acf_the_content()
This little discovery made my entire year!
#wcyyc @tammalee
ACF and Template Partials
This is way too complicated to go into so links!
My pal Don does his this way:
https://gist.github.com/tammalee/f646fe3526a5711d1e1516400e351606
I do mine this way:
https://gist.github.com/tammalee/c287220405420de560475c9071c12b72
#wcyyc @tammalee
MU-Plugins
#wcyyc @tammalee
Must-Use Plugins
I use mu-plugins for:
Custom post types
A site class
First, what is a Must-use plugin and why do I use
them for custom post types and a site class?
#wcyyc @tammalee
Must-Use Plugins
“Must-use plugins (a.k.a. mu-plugins) are plugins
installed in a special directory inside the content folder
and which are automatically enabled on all sites in the
installation. Must-use plugins do not show in the
default list of plugins on the Plugins page of
wp-admin – although they do appear in a special
Must-Use section – and cannot be disabled except by
removing the plugin file from the must-use directory,
which is found in wp-content/mu-plugins by default.”
#wcyyc @tammalee
Must-Use Plugins
Certain functionality and data should be kept separate
from themes. Period.
E.g. A client has entered fifty products into their site but
then they decide they want to switch themes. If the
product custom post type is part of that initial theme,
they will ‘lose’ their products when they switch themes!
You could use a CPT plugin, and I have done this, but if a
CPT is integral to a site, I prefer a mu-plugin. Why?
#wcyyc @tammalee
Must-Use Plugins
“Always-on, no need to enable via admin and users
cannot disable by accident.
Can be enabled simply by uploading file to the
mu-plugins directory, without having to log-in.
Loaded by PHP, in alphabetical order, before normal
plugins, meaning API hooks added in an mu-plugin
apply to all other plugins even if they run
hooked-functions in the global namespace.”
#wcyyc @tammalee
Must-Use Plugins - CPT
/**
* @wordpress-plugin
* Plugin Name: Testimonials custom post type
* Plugin URI: [URL HERE]
* Description: Testimonials custom post type
* Version: 1.0.0
* Author: [AUTHOR HERE]
* Author URI: [AUTHOR URI HERE]
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: [TEXT DOMAIN HERE
* Domain Path: /languages
*/
#wcyyc @tammalee
Must-Use Plugins - CPT
// If this file is called directly, die.
if (!defined('WPINC')) {
Die;
}
add_action('init', function () {
$args = [ARRAY OF ARGUMENTS HERE];
register_post_type('testimonials', $args);
}, 0);
#wcyyc @tammalee
MU-Plugin Site Class
● Why make a site class and what goes into it?
Functionality.
● remove_action/filter() I throw them here. I don’t want
them on the site regardless of the theme
● add_filter/action() Like enabling SVG upload/display
● add_shortcode() If I switch themes, I don’t want the main
shortcodes in my content to break! E.g. buttons
● Any other function that you want separate from
presentation. I also put Gravity Forms filters here, for
example and my ACF template partials function
#wcyyc @tammalee
Bits n Bobs!
#wcyyc @tammalee
Using the Customize API
Advanced Custom Fields
Customize API 1st load
Built-in Social menu in 2017 theme
CHECK THAT OUT! 9 queries vs. 13!
#wcyyc @tammalee
#wcyyc @tammalee
#wcyyc @tammalee
Favourite Templating Functions
get_theme_file_uri()
Instead of get_template_directory_uri()! If it can't find what you're
looking for in the child theme, it looks for the file in the parent theme!
get_template_part() - Even works inside /template-parts!
get_template_part( 'template-parts/content', 'page-header' )
#wcyyc @tammalee
Gist: https://gist.github.com/tammalee/e9ab6c9d040fcbd322a585f6f5c971f7
Strip P tag from IMG and IFRAME tags
#wcyyc @tammalee
Scripts/Styles only when you need them
#wcyyc @tammalee
Enqueueing Google Fonts
Easy peasy lemon— Don’t just put
this stuff in the header! >:(
Enqueue things!
#wcyyc @tammalee
Enqueueing Typekit
#wcyyc @tammalee
Removing version variable from styles and scripts
#wcyyc @tammalee
THANK YOU!
@tammalee
Development Director
@kickpointinc
www.kickpoint.ca
#stardewvalley
#slimeranchinglifestyle

More Related Content

What's hot

Professional WordPress Workflow - WPDay 2015
Professional WordPress Workflow - WPDay 2015 Professional WordPress Workflow - WPDay 2015
Professional WordPress Workflow - WPDay 2015 Maurizio Pelizzone
 
Flex For Flash Developers Ff 2006 Final
Flex For Flash Developers Ff 2006 FinalFlex For Flash Developers Ff 2006 Final
Flex For Flash Developers Ff 2006 Finalematrix
 
Lecture2 interactive-start
Lecture2 interactive-startLecture2 interactive-start
Lecture2 interactive-startDennis Seidel
 
Ako na vlastne WP temy
Ako na vlastne WP temyAko na vlastne WP temy
Ako na vlastne WP temyJuraj Kiss
 
Wordpress to Facebook and Back Again
Wordpress to Facebook and Back AgainWordpress to Facebook and Back Again
Wordpress to Facebook and Back AgainJohn Eckman
 
Conditional Love - Using WordPress Conditional Tags to Write More Effective T...
Conditional Love - Using WordPress Conditional Tags to Write More Effective T...Conditional Love - Using WordPress Conditional Tags to Write More Effective T...
Conditional Love - Using WordPress Conditional Tags to Write More Effective T...Christian Nolen
 
Programming to the Twitter API: ReTweeter
Programming to the Twitter API: ReTweeterProgramming to the Twitter API: ReTweeter
Programming to the Twitter API: ReTweeterJohn Eckman
 
SEO Before Yoast: WordCamp Rhode Island
SEO Before Yoast: WordCamp Rhode IslandSEO Before Yoast: WordCamp Rhode Island
SEO Before Yoast: WordCamp Rhode IslandKerch McConlogue
 
Building a Single Page Application using Ember.js ... for fun and profit
Building a Single Page Application using Ember.js ... for fun and profitBuilding a Single Page Application using Ember.js ... for fun and profit
Building a Single Page Application using Ember.js ... for fun and profitBen Limmer
 
Web 2.0 Lessonplan Day1
Web 2.0 Lessonplan Day1Web 2.0 Lessonplan Day1
Web 2.0 Lessonplan Day1Jesse Thomas
 
Fast Loading JavaScript
Fast Loading JavaScriptFast Loading JavaScript
Fast Loading JavaScriptAaron Peters
 

What's hot (12)

Professional WordPress Workflow - WPDay 2015
Professional WordPress Workflow - WPDay 2015 Professional WordPress Workflow - WPDay 2015
Professional WordPress Workflow - WPDay 2015
 
Flex For Flash Developers Ff 2006 Final
Flex For Flash Developers Ff 2006 FinalFlex For Flash Developers Ff 2006 Final
Flex For Flash Developers Ff 2006 Final
 
Lecture2 interactive-start
Lecture2 interactive-startLecture2 interactive-start
Lecture2 interactive-start
 
Untangling7
Untangling7Untangling7
Untangling7
 
Ako na vlastne WP temy
Ako na vlastne WP temyAko na vlastne WP temy
Ako na vlastne WP temy
 
Wordpress to Facebook and Back Again
Wordpress to Facebook and Back AgainWordpress to Facebook and Back Again
Wordpress to Facebook and Back Again
 
Conditional Love - Using WordPress Conditional Tags to Write More Effective T...
Conditional Love - Using WordPress Conditional Tags to Write More Effective T...Conditional Love - Using WordPress Conditional Tags to Write More Effective T...
Conditional Love - Using WordPress Conditional Tags to Write More Effective T...
 
Programming to the Twitter API: ReTweeter
Programming to the Twitter API: ReTweeterProgramming to the Twitter API: ReTweeter
Programming to the Twitter API: ReTweeter
 
SEO Before Yoast: WordCamp Rhode Island
SEO Before Yoast: WordCamp Rhode IslandSEO Before Yoast: WordCamp Rhode Island
SEO Before Yoast: WordCamp Rhode Island
 
Building a Single Page Application using Ember.js ... for fun and profit
Building a Single Page Application using Ember.js ... for fun and profitBuilding a Single Page Application using Ember.js ... for fun and profit
Building a Single Page Application using Ember.js ... for fun and profit
 
Web 2.0 Lessonplan Day1
Web 2.0 Lessonplan Day1Web 2.0 Lessonplan Day1
Web 2.0 Lessonplan Day1
 
Fast Loading JavaScript
Fast Loading JavaScriptFast Loading JavaScript
Fast Loading JavaScript
 

Similar to A Pocketful of Pro-tips

Magento 2 Best Practice Workfow // David Lambauer // Meet Magento 2017 // Lei...
Magento 2 Best Practice Workfow // David Lambauer // Meet Magento 2017 // Lei...Magento 2 Best Practice Workfow // David Lambauer // Meet Magento 2017 // Lei...
Magento 2 Best Practice Workfow // David Lambauer // Meet Magento 2017 // Lei...AOE
 
Challenges of building a search engine like web rendering service
Challenges of building a search engine like web rendering serviceChallenges of building a search engine like web rendering service
Challenges of building a search engine like web rendering serviceGiacomo Zecchini
 
Web Components
Web ComponentsWeb Components
Web ComponentsFITC
 
Having fun with Google Tag Manager (implement cool things like weather tracki...
Having fun with Google Tag Manager (implement cool things like weather tracki...Having fun with Google Tag Manager (implement cool things like weather tracki...
Having fun with Google Tag Manager (implement cool things like weather tracki...Eventz.Digital
 
JS Fest 2019. Minko Gechev. Building Fast Angular Applications by Default
JS Fest 2019. Minko Gechev. Building Fast Angular Applications by DefaultJS Fest 2019. Minko Gechev. Building Fast Angular Applications by Default
JS Fest 2019. Minko Gechev. Building Fast Angular Applications by DefaultJSFestUA
 
WordPress Plugin Development 201
WordPress Plugin Development 201WordPress Plugin Development 201
WordPress Plugin Development 201ylefebvre
 
Polymer is production ready, how about you?
Polymer is production ready, how about you?Polymer is production ready, how about you?
Polymer is production ready, how about you?Codemotion
 
Build and Deploy a Python Web App to Amazon in 30 Mins
Build and Deploy a Python Web App to Amazon in 30 MinsBuild and Deploy a Python Web App to Amazon in 30 Mins
Build and Deploy a Python Web App to Amazon in 30 MinsJeff Hull
 
Web Components
Web ComponentsWeb Components
Web ComponentsFITC
 
Delhi student's day
Delhi student's dayDelhi student's day
Delhi student's dayAnkur Mishra
 
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTYWilliam Chong
 
How to create your own WordPress plugin
How to create your own WordPress pluginHow to create your own WordPress plugin
How to create your own WordPress pluginJohn Tighe
 
Lipstick on a Magical Pony: dynamic web pages without Javascript
Lipstick on a Magical Pony: dynamic web pages without JavascriptLipstick on a Magical Pony: dynamic web pages without Javascript
Lipstick on a Magical Pony: dynamic web pages without JavascriptTim Bell
 
TechSEO Boost 2021 - Rendering Strategies: Measuring the Devil’s Details in C...
TechSEO Boost 2021 - Rendering Strategies: Measuring the Devil’s Details in C...TechSEO Boost 2021 - Rendering Strategies: Measuring the Devil’s Details in C...
TechSEO Boost 2021 - Rendering Strategies: Measuring the Devil’s Details in C...Catalyst
 
All about google tag manager - Basics
All about google tag manager - Basics All about google tag manager - Basics
All about google tag manager - Basics Rob Levish
 
Insta Builder 2 The Best Site Editing program
Insta Builder 2 The Best Site Editing programInsta Builder 2 The Best Site Editing program
Insta Builder 2 The Best Site Editing programplausibleabdome35
 
ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 3/3 - Web Components avec Po...
ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 3/3 - Web Components avec Po...ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 3/3 - Web Components avec Po...
ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 3/3 - Web Components avec Po...Horacio Gonzalez
 

Similar to A Pocketful of Pro-tips (20)

Magento 2 Best Practice Workfow // David Lambauer // Meet Magento 2017 // Lei...
Magento 2 Best Practice Workfow // David Lambauer // Meet Magento 2017 // Lei...Magento 2 Best Practice Workfow // David Lambauer // Meet Magento 2017 // Lei...
Magento 2 Best Practice Workfow // David Lambauer // Meet Magento 2017 // Lei...
 
Challenges of building a search engine like web rendering service
Challenges of building a search engine like web rendering serviceChallenges of building a search engine like web rendering service
Challenges of building a search engine like web rendering service
 
Web Components
Web ComponentsWeb Components
Web Components
 
Having fun with Google Tag Manager (implement cool things like weather tracki...
Having fun with Google Tag Manager (implement cool things like weather tracki...Having fun with Google Tag Manager (implement cool things like weather tracki...
Having fun with Google Tag Manager (implement cool things like weather tracki...
 
JS Fest 2019. Minko Gechev. Building Fast Angular Applications by Default
JS Fest 2019. Minko Gechev. Building Fast Angular Applications by DefaultJS Fest 2019. Minko Gechev. Building Fast Angular Applications by Default
JS Fest 2019. Minko Gechev. Building Fast Angular Applications by Default
 
WordPress Plugin Development 201
WordPress Plugin Development 201WordPress Plugin Development 201
WordPress Plugin Development 201
 
Polymer is production ready, how about you?
Polymer is production ready, how about you?Polymer is production ready, how about you?
Polymer is production ready, how about you?
 
8fig
8fig8fig
8fig
 
INTRODUCTIONS OF HTML
INTRODUCTIONS OF HTMLINTRODUCTIONS OF HTML
INTRODUCTIONS OF HTML
 
Build and Deploy a Python Web App to Amazon in 30 Mins
Build and Deploy a Python Web App to Amazon in 30 MinsBuild and Deploy a Python Web App to Amazon in 30 Mins
Build and Deploy a Python Web App to Amazon in 30 Mins
 
Web Components
Web ComponentsWeb Components
Web Components
 
Delhi student's day
Delhi student's dayDelhi student's day
Delhi student's day
 
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY
5 年後還是新手 - WordPress Plugin 開發大冒險 - GOTY
 
Fundamentals of HTML5
Fundamentals of HTML5Fundamentals of HTML5
Fundamentals of HTML5
 
How to create your own WordPress plugin
How to create your own WordPress pluginHow to create your own WordPress plugin
How to create your own WordPress plugin
 
Lipstick on a Magical Pony: dynamic web pages without Javascript
Lipstick on a Magical Pony: dynamic web pages without JavascriptLipstick on a Magical Pony: dynamic web pages without Javascript
Lipstick on a Magical Pony: dynamic web pages without Javascript
 
TechSEO Boost 2021 - Rendering Strategies: Measuring the Devil’s Details in C...
TechSEO Boost 2021 - Rendering Strategies: Measuring the Devil’s Details in C...TechSEO Boost 2021 - Rendering Strategies: Measuring the Devil’s Details in C...
TechSEO Boost 2021 - Rendering Strategies: Measuring the Devil’s Details in C...
 
All about google tag manager - Basics
All about google tag manager - Basics All about google tag manager - Basics
All about google tag manager - Basics
 
Insta Builder 2 The Best Site Editing program
Insta Builder 2 The Best Site Editing programInsta Builder 2 The Best Site Editing program
Insta Builder 2 The Best Site Editing program
 
ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 3/3 - Web Components avec Po...
ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 3/3 - Web Components avec Po...ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 3/3 - Web Components avec Po...
ENIB 2015 2016 - CAI Web S02E01- Côté Navigateur 3/3 - Web Components avec Po...
 

Recently uploaded

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 

Recently uploaded (20)

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 

A Pocketful of Pro-tips

  • 1. #wcyyc @tammalee TAMMY VALGARDSON @tammalee @kickpointinc Development Director Figure-outer of things Code snippets in this talk are here: https://gist.github.com/tammalee I have attributed sources where I can! But some sources are lost in the mists of time. Sorry.
  • 2. #wcyyc @tammalee Pocket Full of Pro-tips* Tammy Valgardson * A dry technical talk livened up by gnomes and rainbows!
  • 4. #wcyyc @tammalee You, a developer, are not alone, anymore.* * Unless you're a freelancer. Sorry. You might be alone. :(
  • 5. #wcyyc @tammalee Big Picture Considerations UX/Design ● Component behaviour (animations, transitions, responsiveness) ● Micro-copy (Those teeny messages that frustrate users) ● Performance (How many fonts are we loading? D:) ● Established web conventions reminders Digital Marketing ● URL structure ● URL STRUCTURE ● UUUURRRRLL… you get the picture ● Relevant markup ● Schema ● Little things like, 'external links must open in a new tab' ● GTM/GA implementation ● Client goals and other things that are good to know at the beginning of a build!
  • 6. #wcyyc @tammalee Big Picture Protips How to save yourself time and hours down the road. ● Know the finished site structure and URLs ● Know what is going to be tracked with what marketing tool ● Don't assume anything about the design & get the final content early ● Make sure all utility pages have been touched on (e.g. 404 page)
  • 7. #wcyyc @tammalee You are still the expert when it comes to building things!
  • 9. #wcyyc @tammalee Google Analytics 1. Use the wp_head action to insert the code snippet into your header via the functions.php file 2. Copy and paste the code snippet directly into your header.php file DO NOT Install a plugin JUST to insert GA code! (I will talk so much smack about you if you do) Gnarr!
  • 10. #wcyyc @tammalee Go one better, and install Google Tag Manager instead of just Google Analytics
  • 11. #wcyyc @tammalee What is GTM? (Google Tag Manager) GTM is is a free tool that makes it easy for marketers to add and update website tags -- including conversion tracking, site analytics, remarketing, and more—with just a few clicks, and without needing to edit your website code. I like it because it means less people need to touch the code! Touch mah code and I cut U! j/k
  • 12. #wcyyc @tammalee GTM Templates Instead of starting from scratch every time you create a GTM container for a new site, create a template you can export and import into the new container! Click on your template container then go to Admin. You’ll see Export Container and Import Container links.
  • 13. #wcyyc @tammalee Installing Google Tag Manager You'll be given two code snippets. One goes between the <head></head> tags in your header.php file and the other goes right after the opening <body> tag in your header.php file. Because the snippets are split, and WordPress doesn’t have a native ‘after_body()’ hook, I usually just edit my header.php file. Then I feel dirty there wasn’t a better way. (A PLUGIN IS NOT A BETTER WAY!)
  • 15. #wcyyc @tammalee GTM - Welcome to the data layer Most of the time, it's pretty straightforward to create GTM tags. But when it comes to tracking form events, things seem to fall apart. I blame AJAX. Sometimes, to track a form or eCommerce interaction properly you need to use the GTM data layer. The data layer is a JavaScript array that needs to be on your site, which is why a developer needs to be involved.
  • 16. #wcyyc @tammalee Data layer push using Mailchimp 4 WordPress ● Create a GTM variable called formId ● Create a GTM trigger ● Create a GTM tag ● Add data layer code on your site that will send a variable called ‘formId’ to GTM ● Celebrate when you start seeing results! Let’s break it down a bit further.
  • 17. #wcyyc @tammalee Create a GTM variable called formId
  • 21. #wcyyc @tammalee GTM - Gravity Forms Same steps as before, but this time we are using a PHP hook instead of a JS one. And what if you want to pass over the value of a drop down field?
  • 22. #wcyyc @tammalee GTM - Gravity Forms In addition to the formId variable, you’ll need to create a variable for the new value we’re passing.
  • 23. #wcyyc @tammalee GTM - Gravity Forms My Trigger was the same as last time, formId but now I can use my new data layer variable as a label in my tag!
  • 27. #wcyyc @tammalee ACF Local JSON “Local JSON is a new feature added in version 5 which saves field group and field settings to files within your theme. The idea is similar to caching and both dramatically speeds up ACF and allows for version control over your field settings!” https://www.advancedcustomfields.com/resources/local-json/ Vroom vroom! Let’s speed up ACF!
  • 28. #wcyyc @tammalee ACF Local JSON ● Go to your theme folder ● Create a new folder called acf-json ● Go to the Custom Fields area of your WordPress admin and save each of your custom fields to generate JSON files ● Performance Seriously, that’s all there is to it! So, what did that do?
  • 29. #wcyyc @tammalee We went from this: ACF Local JSON To this (on a locally hosted site): [Page generation time / Peak memory usage / DB query time / DB queries]
  • 30. #wcyyc @tammalee Query Monitor “Query Monitor is a debugging plugin for anyone developing with WordPress. It has some advanced features not available in other debugging plugins, including debugging of AJAX calls, REST API requests, redirects, and the ability to narrow down its output by plugin or theme.” https://en-ca.wordpress.org/plugins/query-monitor/ This plugin is great! It’s how I test performance while developing.
  • 31. #wcyyc @tammalee acf_the_content() WP has the_content() ACF has acf_the_content() This little discovery made my entire year!
  • 32. #wcyyc @tammalee ACF and Template Partials This is way too complicated to go into so links! My pal Don does his this way: https://gist.github.com/tammalee/f646fe3526a5711d1e1516400e351606 I do mine this way: https://gist.github.com/tammalee/c287220405420de560475c9071c12b72
  • 34. #wcyyc @tammalee Must-Use Plugins I use mu-plugins for: Custom post types A site class First, what is a Must-use plugin and why do I use them for custom post types and a site class?
  • 35. #wcyyc @tammalee Must-Use Plugins “Must-use plugins (a.k.a. mu-plugins) are plugins installed in a special directory inside the content folder and which are automatically enabled on all sites in the installation. Must-use plugins do not show in the default list of plugins on the Plugins page of wp-admin – although they do appear in a special Must-Use section – and cannot be disabled except by removing the plugin file from the must-use directory, which is found in wp-content/mu-plugins by default.”
  • 36. #wcyyc @tammalee Must-Use Plugins Certain functionality and data should be kept separate from themes. Period. E.g. A client has entered fifty products into their site but then they decide they want to switch themes. If the product custom post type is part of that initial theme, they will ‘lose’ their products when they switch themes! You could use a CPT plugin, and I have done this, but if a CPT is integral to a site, I prefer a mu-plugin. Why?
  • 37. #wcyyc @tammalee Must-Use Plugins “Always-on, no need to enable via admin and users cannot disable by accident. Can be enabled simply by uploading file to the mu-plugins directory, without having to log-in. Loaded by PHP, in alphabetical order, before normal plugins, meaning API hooks added in an mu-plugin apply to all other plugins even if they run hooked-functions in the global namespace.”
  • 38. #wcyyc @tammalee Must-Use Plugins - CPT /** * @wordpress-plugin * Plugin Name: Testimonials custom post type * Plugin URI: [URL HERE] * Description: Testimonials custom post type * Version: 1.0.0 * Author: [AUTHOR HERE] * Author URI: [AUTHOR URI HERE] * License: GPL-2.0+ * License URI: http://www.gnu.org/licenses/gpl-2.0.txt * Text Domain: [TEXT DOMAIN HERE * Domain Path: /languages */
  • 39. #wcyyc @tammalee Must-Use Plugins - CPT // If this file is called directly, die. if (!defined('WPINC')) { Die; } add_action('init', function () { $args = [ARRAY OF ARGUMENTS HERE]; register_post_type('testimonials', $args); }, 0);
  • 40. #wcyyc @tammalee MU-Plugin Site Class ● Why make a site class and what goes into it? Functionality. ● remove_action/filter() I throw them here. I don’t want them on the site regardless of the theme ● add_filter/action() Like enabling SVG upload/display ● add_shortcode() If I switch themes, I don’t want the main shortcodes in my content to break! E.g. buttons ● Any other function that you want separate from presentation. I also put Gravity Forms filters here, for example and my ACF template partials function
  • 42. #wcyyc @tammalee Using the Customize API Advanced Custom Fields Customize API 1st load Built-in Social menu in 2017 theme CHECK THAT OUT! 9 queries vs. 13!
  • 45. #wcyyc @tammalee Favourite Templating Functions get_theme_file_uri() Instead of get_template_directory_uri()! If it can't find what you're looking for in the child theme, it looks for the file in the parent theme! get_template_part() - Even works inside /template-parts! get_template_part( 'template-parts/content', 'page-header' )
  • 48. #wcyyc @tammalee Enqueueing Google Fonts Easy peasy lemon— Don’t just put this stuff in the header! >:( Enqueue things!
  • 50. #wcyyc @tammalee Removing version variable from styles and scripts
  • 51. #wcyyc @tammalee THANK YOU! @tammalee Development Director @kickpointinc www.kickpoint.ca #stardewvalley #slimeranchinglifestyle