WooCommerce – Enable Admin Bar
add_filter( ‘woocommerce_disable_admin_bar’, ‘__return_false’ );Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
add_filter( ‘woocommerce_disable_admin_bar’, ‘__return_false’ );Continue reading
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
add_action( ‘wp_footer’, function() { ?>Continue reading
/** * Promote the hero image (LCP) site-wide: * – fetchpriority=”high”, loading=”eager” * – remove lazy markers from LiteSpeed/Smush * – inject in * Works on every page using the shared hero structure. */ add_action( ‘wp_head’, function () { ?>Continue reading
function calcular_valor_do_repeater_acf( $post_id ) { $etapas = ‘etapas’; $tarefas = ‘tarefas’; $checkbox = ‘feito’; $progresso_etapa = ‘progresso_da_etapa’; $progresso_projeto = ‘progresso_do_projeto’; // Check rows exists. if( have_rows($etapas) ): $rows_etapas = 0; $progress_etapas = 0; while( have_rows($etapas) ) : the_row(); // Loop…Continue reading
/** * 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
// 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
for ($i=2; $iContinue reading
$date = date(‘Y-m-d h:i:s a’); echo “It works here: $date “;Continue reading