Skip to content

Fallback Post Thumbnail (Featured Image)

Fallback Post Thumbnail (Featured Image)

This snippet will allow you to set a fallback featured image anytime a featured image (post thumbnail) is requested on your WordPress site. The first function will add the post_thumbnail_id filter which doesn't exist by default in WP core and…

Read more

ScrollTo and Open VC Toggle/FAQ

// ScrollTo and Open VC Toggle/FAQ // Usage: Give your toggle a unique ID // Then link to it like this site.com/?toggle-id add_action( 'wp_footer', function() { ?> ( function( $ ) { 'use strict'; // Run on window load (best…

Read more

Add Custom Widget Area to Bottom of Sidebar Mobile Menu

// Add new widget area "toggle_sidebar" add_action( 'widgets_init', function() { register_sidebar( array( 'name' => 'Toggle Sidebar', 'id' => 'mobile_menu_sidr_widgets', 'before_widget' => '', 'after_widget' => '', 'before_title' => '', 'after_title' => '', ) ); }, 10 ); // Change the 10…

Read more

Conditionally Alter Topbar Content

add_filter( 'totaltheme/topbar/content', function( $content ) { if ( is_page( 'about' ) ) { $content = 'Custom Content'; // Return custom content for the about page } return $content; } );

Read more
Back To Top