add post formats

// available formats: // aside, gallery, link, image, quote, status, video, audio, chat function theme_post_formats_setup() { add_theme_support( ‘post-formats’, array( ‘quote’, ‘image’, ‘link’, ‘gallery’, ‘status’, ‘aside’, ‘chat’ ) ); } add_action( ‘after_setup_theme’, ‘theme_post_formats_setup’ ); // If using a child theme add_action(…Continue reading

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’ ); wp_register_style( ‘bootstrap5_css’, ‘https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.3/css/bootstrap.min.css’, array(), ‘5.3.3’, true ); wp_enqueue_style( ‘bootstrap5_css’ ); wp_register_style( ‘bootstrap5_css_containers’, ‘https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.3/scss/_containers.scss’, array(), ‘5.3.3’, true ); wp_enqueue_style( ‘bootstrap5_css_containers’ ); } add_action( ‘wp_enqueue_scripts’,…Continue reading

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_action( ‘wp_enqueue_scripts’, ‘add_custom_script_webfont_loader_js’ );Continue reading

fontfaceObserver.js

// Detect if web fonts are available function add_custom_script_font_face_observer_js() { wp_register_script( ‘fontface_observer’, ‘https://cdnjs.cloudflare.com/ajax/libs/fontfaceobserver/2.3.0/fontfaceobserver.standalone.js’, array(), ‘2.3.0’, true ); wp_enqueue_script( ‘fontface_observer’ ); } add_action( ‘wp_enqueue_scripts’, ‘add_custom_script_font_face_observer_js’ );Continue reading

masonry.js

// Add custom scripts function add_custom_script_masonry_js() { wp_register_script( ‘masonry’, ‘https://unpkg.com/masonry-layout@4/dist/masonry.pkgd.min.js’, array(), ‘4’, true ); wp_enqueue_script( ‘masonry’ ); } add_action( ‘wp_enqueue_scripts’, ‘add_custom_script_masonry_js’ );Continue reading

fullPage.js

// Add custom scripts function add_custom_script_fullpage_js() { wp_register_script( ‘fullpage’, ‘https://cdnjs.cloudflare.com/ajax/libs/fullPage.js/4.0.29/fullpage.min.js’, array(), ‘4.0.29’, false ); wp_enqueue_script( ‘fullpage’ ); } add_action( ‘wp_enqueue_scripts’, ‘add_custom_script_fullpage_js’ );Continue reading

CSS – ILAJ

h4.gold { border-left-color: gold; border-left-style: solid; border-left-width: 4px; padding-left: 10px; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: lightsteelblue; } h3.gold { border-bottom-color: gold; border-bottom-style: solid; border-bottom-width: 3px; } h2.gold { background-color: gold; padding-left: 10px; } h3.brown { text-decoration-line: underline; text-decoration-color: goldenrod; text-decoration-style:…Continue reading

Add the Page Slug to Body Class (copy)

function wpcode_snippet_add_slug_body_class( $classes ) { global $post; if ( isset( $post ) ) { $classes[] = $post->post_type . ‘-‘ . $post->post_name; } return $classes; } add_filter( ‘body_class’, ‘wpcode_snippet_add_slug_body_class’ );Continue reading