About

Amateur hobbyist

28 Snippets
10+ Favourites
10+ Downloads

Code for importing theme files from plugin

Generated by Meta.AI /** * Import an entire folder from a plugin into the WordPress theme.…

Dynamic Copyright & Current Year Shortcodes

Add this snippet to the functions.php file in your theme or plugin. Compatible with both classic…

WPCode Functions

For the WPCode plugin interface

webfontloader.js

// Add custom scripts function add_custom_script_webfont_loader_js() { wp_register_script( 'webfontloader', 'https://cdnjs.cloudflare.com/ajax/libs/webfont/1.6.28/webfontloader.js', array(), '1.6.28', true ); wp_enqueue_script( 'webfontloader'…

add post formats

Adding different types of post formats: aside – Typically styled without a title. Similar to a…

Replace [year] with the current year

Type [year] anywhere that you want the current year to be inserted.

masonry.js

Register and Enqueue masonry.js library for grid layouts

fontfaceObserver.js

Detect if web fonts are available

Add Theme Supports

Reference: https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#opt-in-features

Bootstrap 5

// Add custom scripts function add_custom_script_bootstrap5() { wp_register_script( 'bootstrap5_js', 'https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.3/js/bootstrap.min.js', array(), '5.3.3', true ); wp_enqueue_script( 'bootstrap5_js'…

Typography Enqueue

function typography_enqueue_styles() { // Enqueue Typeboost.css from Cloudflare CDN wp_enqueue_style('typeboost-css', 'https://cdnjs.cloudflare.com/ajax/libs/typeboost/1.0.0/typeboost.css', array(), '1.0.0'); // Enqueue webfontloader.js…

1 2 3