Location: everywhere
Enable Top-Bar Rendering via GET Variable and ACF Options Page Toggle
if (!defined(‘ABSPATH’)) exit; add_action(‘init’, function () { if (is_admin()) return; $enabled = get_field(‘enable_header_top-bar’, ‘option’) ? ‘1’ : ‘0’; if ($enabled === ‘1’) { $_GET[‘rd_topbar_toggle’] = ‘1’; } else { unset($_GET[‘rd_topbar_toggle’]); } });Continue reading
Save Options Page Top-Bar Settings to Global Header Section Post
if (!defined(‘ABSPATH’)) exit; define(‘TARGET_POST_ID’, 7183); // Specify the post ID of the layout section that should receive the values add_action(‘acf/save_post’, function ($post_id) { if ($post_id !== ‘options’) { return; } $enabled = get_field(‘enable_header_top-bar’, ‘option’) ? ‘1’ : ”; // specify…Continue reading
WooCommerce – Enable Admin Bar
add_filter( ‘woocommerce_disable_admin_bar’, ‘__return_false’ );Continue reading
Add Manage Affiliates Capability to WooCommerce Shop Manager Role
function add_manage_affiliates_cap_to_shop_manager() { // Get the role object $shop_manager = get_role( ‘shop_manager’ ); // Add capability to the role object if ( $shop_manager ) { $shop_manager->add_cap( ‘manage_affiliates’ ); } } add_action( ‘init’, ‘add_manage_affiliates_cap_to_shop_manager’ );Continue reading
Always enable Downloadable option
add_action( ‘wp_footer’, function() { ?>Continue reading
Allow SVG Files Upload
/** * Allow SVG uploads for administrator users. * * @param array $upload_mimes Allowed mime types. * * @return mixed */ add_filter( ‘upload_mimes’, function ( $upload_mimes ) { // By default, only administrator users are allowed to add SVGs. //…Continue reading
WP Rocket instellingen
// 1. Activeer caching add_filter( ‘rocket_enable_cache’, ‘__return_true’ ); add_filter( ‘rocket_cache_mobile’, ‘__return_true’ ); add_filter( ‘rocket_separate_mobile_cache’, ‘__return_true’ ); // 2. Preload cache en fonts add_filter( ‘do_rocket_generate_caching_files’, ‘__return_true’ ); add_filter( ‘rocket_preload_cache’, ‘__return_true’ ); add_filter( ‘rocket_font_preload’, function( $fonts ) { return array( ‘/wp-content/themes/jouwthema/fonts/roboto.woff2’, ‘/wp-content/themes/jouwthema/fonts/open-sans.woff2’,…Continue reading
Meta Pixel
It Works!
$date = date(‘Y-m-d h:i:s a’); echo “It works here: $date “;Continue reading