Code Snippets
These code snippets are more developer focused than my tutorials.
Use the live search form below to filter the list.
- Logo dimensions as CSS variable
- Disable loading=”lazy” on images in first block
- Set max srcset image to 2x
- Author archive link pointed to about page
- WP Recipe Maker – query for posts with videos in recipe card
- Track PWA install in Google Analytics
- WPForms Order Number
- Rename category taxonomy
- Automatic alt tags on images in WordPress
- wp cli, save-permalink
- Google Charts
- WP Recipe Maker – template styles
- Disable Genesis breadcrumbs on top level pages
- Percent Quote
- Select styling
- WPForms custom honeypot
- Add span to heading block
- Heading with line
- Scrolling Section
- Exclude no-index content from WordPress search
- Post Listing – Scroll Section
- Mediavine Create – Recipe Rating
- Mediavine Create – Recipe Description
- WP Recipe Maker – Video Instructions
- FacetWP – Only direct children
- Custom logo
- Genesis Grid – move images above title
- Scrape images from Instagram
- Tweet Blockquote in Gutenberg
- Integrate ConvertKit & WPForms: Include custom fields
- Customizer Setting
- Set PHP Cookie
- Slick – Custom Arrow Navigation
- Get menu item objects for theme location
- Persistent Header
- Published & Modified Date Shortcode
- Use Yoast SEO meta title in site search
- Yoast Schema – Use Genesis Image
- WPForms submit button – match Gutenberg button block
- WPForms – theme locations
- SearchWP Metrics with Live Search
- CSS Blend Modes
- Display SVG social icons in menu
- Search Results Heading
- SearchWP – Change sort order
- Only title and image in Grid Loop
- Genesis Filter Reference
- Genesis Hook Reference
- Mass update user roles using wp cli
- WPForms – Pass form data to another form
- Color Palette Setup in Gutenberg
- WPForms – Dynamic availability in booking form
- Default system font stack
- WP Recipe Maker – Get ID and recipe data
- CSS Grid Auto-fill columns
- DPS Default Image
- SearchWP Related on specific post types
- Remove avatars from comments
- Display WPForms entry data on confirmation page
- Use a div for post info in Genesis
- Dynamic icon select in Advanced Custom Fields
- Table of Contents block
- Include introductory text on Genesis blog archive
- TinyMCE Plugin: Feature Box
- Shortcode UI Examples
- Flexbox center columns
- Migrate data from Taxonomy Images to WP Term Images
- Include Shared Counts in Display Posts Shortcode
- Schema Markup for Display Posts Shortcode
- Related Posts with SearchWP
- WPForms, encoded query string
- Displaying social links from Yoast SEO
- Use a different image for large favicon / site icon
- Show total share count for “included total” field
- Blacklist Menu Item Classes
- Whitelist Menu Item Classes
- Find Largest Autoloaded Options
- Manually Display Shared Counts
- Move Shared Counts to a different hook or filter
- Use Production URL in Shared Counts
- Preload header image
- Polylang support for Display Posts Shortcode
- Integrate ConvertKit & WPForms: Only add user if checkbox is checked
- Progress Bar
- Don’t display low share counts
- SASS loops
- Add username to twitter share
- Add checkbox to Featured Image metabox
- Remove links from comment names
- Disable Shared Counts on certain categories
- Update header on scroll
- Integrate Genesis Title Toggle with Custom Theme
- Shared Counts – Change label for total field
- Remove sticky posts from main loop
- Convert Google Maps links to Apple Maps on iOS
- DPS, Use h2 for post title
- DPS, Add Category Classes
- Placeholder Shortcodes
- DPS Exclude Displayed Posts
- Show upcoming events from The Events Calendar
- Blurred Image
- Using the Display Posts Shortcode Output Filter
- YouTube thumbnail from video url
- Array Insert
- User information from IP
- Custom Rewrite Rules
- EA Share Count, Box Styling
- WPForms, Display description above field
- Table Column Headers on Mobile
- Use placeholders in comment form
- Slick Carousel
- SearchWP Supplemental Engines with main loop
- Password Protected Content
- WPForms – Include form data in the Confirmation URL
- Login Logo
- DPS – Add class to current post
- Plugin Translation
- DPS – Add post type class to posts
- DPS – Remove commas from category output
- WPForms – eBook Download Form
- Disable Share Counts on a page template
- Close item when clicking elsewhere
- Search Toggle
- Sample Custom Post Type
- Sample Widget
- Display posts in current category
- Genesis Title Toggle on all post types
- Post Navigation as buttons
- Display form on one line
- Pin It on Images
- Break Wide Images
- WPForms Custom Smart Tags
- WPForms Smart Tags on HTML Field
- Enable vCard Upload
- Find Large Options
- WPForms Settings Page
- WPForms State Dropdown
- Featured Image Fallback
- Search Autocomplete
- Join Multiple Items
- Disable Pinterest Pin It Button
- Get Exact Image
- Infinite Scroll Archive
- Infinite Scroll Archive – Manual Trigger
- AND Queries in Posts 2 Posts
- Quick Edit Meta
- Hide Empty Editor
- SimmerWP – Simpler Permalink
- Handle Admin Bar Styling in Theme
- Simple HTML Formatting
- Disable ACF on Frontend
- Enqueue WPForms Style in Head
- Display a WPForm with code
- Escape each item in array
- Move the Genesis SEO and Layout metaboxes
- CPT Settings Page using ACF
- ACF Options Page
- Add inline script
- Default Archive Title
- Default Widget Area Arguments
- Default to most recent image
- Display most recent options and post meta using wp cli
- WPForms Email Blacklist
- BE Subpages Widget – Alphabetical Order
- EA Share Count – Update only on single posts
- Responsive Google Map
- Sample gitignore
- Use Facebook Comments for Comment Count
- Phone Number URL
- Previous/Next Posts Link as Button
- Facebook Comment Count Shortcode
- Load different homepage based on WPML language
- EA Share Count – Box Style
- Modify the Featured Image CSS Classes in Genesis
- HIPAA Compliant Contact Form
- Mobile Address Bar Color
- Adding Editor Styles
- Move zip next to state in WPForms
- EA Share Count – Change button location based on share count
- Genesis Grid – Two Columns on Tablet
- Grid Overlay on Website
- Hide mobile navigation when clicking back in Safari
- Use Page Links To with custom metabox
- Facebook Comments Code
- Genesis Title Toggle for Posts
- BE Events Calendar – Enable Categories
- Add taxonomy to Genesis breadcrumb
- EA Share Count – Popular Posts Widget
- EA Share Count – Delete Current Counts
- EA Share Count – Prime the Pump
- EA Share Count – Make fixed on scroll
- EA Share Count – Change Icons
- EA Share Count – Use Production URL
- Use placeholders instead of labels in comment form
- Insert After Paragraph
- Change Grid Arguments for a specific category
- Add site description to site title
- Flexbox with Safari Support
- Submenu items in secondary menu
- Add arrows to menu items
- Add Description to WordPress Menu Items
- Menu items with percentage widths
- Use multiple meta keys for sorting query
- Shortcut Args for Display Posts
- Close Popup Search
- Customize Menu Item Classes
- Touch Screen Detection
- Different Types of Event Queries
- Print and Email links
- Clear a transient when new post published
- Change Default Attributes in Display Posts Shortcode
- Posts 2 Posts limited by taxonomy terms
- Remove post titles in grid
- Mobile Menu icon with just CSS
- Gravity Forms – Filter button so it supports icons
- Sidr Customizations
- SVG Logo with PNG Fallback
- Using Masonry/Isotope and Infinite Scroll with Genesis
- Styled Ordered List
- Background Image on Site Header
- Order results by multiple meta_keys
- Hide empty fields from GET form
- Get Column Classes
- Multi-Level Mobile Menu
- Multiple sizes of favicon
- Smooth Scrolling for anchor links
- Duplicate ‘the_content’ filters
- Enqueue inline styles
- Adjust header when scrolled
- Header for Date Archives
- Remove Post Info and Meta from Teasers
- Two Column Comment Form
- Blog Sidebar in Genesis
- WP Address Schema CSS
- Mega Menu using Post Meta
- Register Multiple Taxonomies
- Remove Link from Title on Display Posts Shortcode
- Move Sidebar Above Content
- Add and Remove Contact Methods
- Get Page Hierarchy
- Add Attachment ID as class on images
- Genesis Shortcodes
- Full width element in middle of page
- Google Static Map using ACF Location Field
- Exclude Listings from Link Search
- Tabbed Widget
- Migrate Thesis Images to Genesis
- Register Most Recent Style
- Desaturate social icons
- Featured Posts in Display Posts Shortcode
- Remove Featured Image from Feature Posts
- Tweetable Blockquote
- Remove Padding from Captions
- Only display Featured Image on Archive
- No Content on Teasers in Grid Loop
- Remove alignleft from featured images
- Vertical Breadcrumbs
- Image Attribute Fallback
- Gallery with images in multiple
- Private Posts visible to Subscribers
- Generate an array of post IDs in current query
- Remove Post Title from Breadcrumb
- Taxonomy Metadata in get_terms()
- Taxonomy Metadata
- Full Height Sidebar
- BE Stats – Change conditions under which rankings are saved
- Customize BE Stats Arguments
- Category ID on Menu Items
- Column Classes
- Use the built-in post counter
- Use Full Content for Features in Grid Loop
- Display Posts Lockdown
- OEmbed Videos in Sidebar
- Genesis Grid – Change length of content in grid
- Limit Genesis Grid to Specific Category
- Add Column Classes to Display Posts Shortcodes
- Mobile Theme Switcher
- Genesis – Change Logo URL
- Rewrite Endpoint to load post with different templates
- Add Custom Image Sizes to Media Uploader
- Fix iOS resizing bug
- WordPress Menu as Select Dropdown (js)
- Gravity Forms labels used as placeholders
- WordPress Menu as Select Dropdown
- Display Posts Shortcode – Display message when no results
- Black and White Image
- Truncate by word or character
- Random Posts widget with caching
- Dynamic Image Resizing
- Old Post Notification – Change Post Types
- Old Post Notification – Remove Default Styling
- Old Post Notification – Display Elsewhere
- Add Taxonomy to Edit Post Columns
- Display Posts – Exclude Current Post
- Display date using timezone from Settings > General
- Responsive Meta Tag
- CSS Width including padding
- oEmbed Transparency
- Remove Inpost Layout Options
- Add Classes to Display Posts Shortcode
- Add Read More to Display Posts Shortcode
- Event Calendar Widget
- Grid Loop, complete file
- Use single template for home, archive, and search
- Grid Loop with Features/Teasers
- Homepage Help
- Customize Author Box
- Automatically Display Author Box
- Pagination in a Custom Query
- Improve performance of WP_Query
- Grid Loop using post class
- WP_Query Arguments
- First Post Class
- Popular Posts Widget
- OEmbed Video from URL
- Change Logo URL
- Update URLs in Database
- Create new profile fields
- Remove unused user fields
- Move Featured Image Metabox
- Editor Width
- Default Content for the Editor
- Customize Roles & Capabilities
- Gravity Forms – UNIX Timestamp
- CMS Page Order – Customize Page Label
- Add Time to Display Posts Shortcode
- Posts 2 Posts – List Connections
- Posts 2 Posts – Create Connection
- Display a Gravity Form
- Gallery Metabox – Change Intro Text
- Display Posts Shortcode – Exclude Posts
- Gallery Metabox – Custom Post Types
- Exclude Pages from Genesis Subpages as Secondary Menu plugin
- Create a UNIX timestamp based on two meta fields
- Install WordPress via SSH
- Helper function for template include and body class
- WP Admin – Current Screen Info
- Get Single Term
- Change post types – CMS Page Order
- Add taxonomy to page names – CMS Page Order
- Limit Gallery Metabox to Specific Page
- Page Links To – Limit to Rotator
- Genesis Subpages – Sort by Name
- Add category to pages
- Exclude term from search
- Gallery Metabox – sort by title
- Display Posts Shortcode – Comma Separated List
- Find Top Level Page
- Image Override – Limit Image Sizes
- Image Override – Limit Post Types
- Shorten User Description
- Add Extra Code to Any Menu
- Add Extra Code to Primary Menu
- Genesis Theme Settings
- Default term for taxonomy
- Add Blog to Breadcrumbs
- Genesis Create Layout
- Custom Avatar Field
- Helpful Shortcodes
- Read More Link
- Add description to menu
- Genesis Customize Site Title
- Genesis Breadcrumb Arguments
- Customize Genesis Search Button Text
- Customize Genesis Search Form Text
- Remove Genesis Footer
- Change Excerpt More Text
- Genesis Post Meta
- Genesis Post Info
- Genesis Structural Wrap
- Genesis – Unregister Layouts
- Genesis Force Layout
- Genesis Theme Setup
- Display Featured Image and Caption
- Set Default Avatar
- Remove metaboxes from Genesis Theme Settings
- Display different content based on user’s past page
- Customize Query in WordPress 3.3
- Event Query
- Add Photo Credits to Media Gallery
- Add “Include in Rotator” option to media uploader
- Get attached images
- Twenty Links – redirect single to link in body
- Display Posts Shortcode – Outer Markup
- Add a Metabox
- How to handle redirects in WordPress, via Otto
- Display Posts Shortcode – Show Author
- Sort posts by comment count
- Interstrategy Events – event information
- Use same template for taxonomy and CPT archive
- Interstrategy Events – Custom Event Information
- Display Posts Shortcode – Full Content
- Display Posts Shortcode – modify date format
- Display Posts Shortcode – Additional Fields
- Gallery Metabox – limit to page template
- Gallery Metabox – show images marked “include in rotator”
- Hide editor on specific page template