This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// remove css js version | |
function remove_cssjs_ver( $src ) { | |
if( strpos( $src, '?ver=' ) ) | |
$src = remove_query_arg( 'ver', $src ); | |
return $src; | |
} | |
add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 ); | |
add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// remove menu class and keep class to active item only | |
add_filter('nav_menu_css_class', 'my_css_attributes_filter', 100, 1); | |
add_filter('nav_menu_item_id', 'my_css_attributes_filter', 100, 1); | |
add_filter('page_css_class', 'my_css_attributes_filter', 100, 1); | |
function my_css_attributes_filter($var) { | |
return is_array($var) ? array_intersect($var, array('current-menu-item')) : ''; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// remove short link | |
remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// remove EMOJI | |
remove_action('wp_head', 'print_emoji_detection_script', 7); | |
remove_action('wp_print_styles', 'print_emoji_styles'); | |
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); | |
remove_action( 'admin_print_styles', 'print_emoji_styles' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// remove auto stylesheet from admin + wp | |
add_action( 'wp_print_styles', 'my_deregister_styles', 100 ); | |
function my_deregister_styles() { | |
wp_deregister_style( 'dashicons' ); | |
wp_deregister_style( 'admin-bar' ); | |
wp_deregister_style( 'open-sans' ); | |
wp_deregister_style( 'boxes' ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style type="text/css"> | |
img.wp-smiley, | |
img.emoji { | |
display: inline !important; | |
border: none !important; | |
box-shadow: none !important; | |
height: 1em !important; | |
width: 1em !important; | |
margin: 0 .07em !important; | |
vertical-align: -0.1em !important; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (function_exists('add_theme_support')) { | |
add_theme_support('post-thumbnails'); | |
} | |
set_post_thumbnail_size( 70, 70); | |
add_image_size( 'single-post-thumbnail', 600, 350 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Deletes all CSS classes and id's, except for those listed in the array below | |
function custom_wp_nav_menu($var) { | |
return is_array($var) ? array_intersect($var, array( | |
//List of allowed menu classes | |
'current_page_item', | |
'current_page_parent', | |
'current_page_ancestor', | |
'first', | |
'last', | |
'vertical', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remove Meta Generator: <meta name="generator" content="WordPress x.x" /> | |
// and <meta name="generator" content="WooCommerce x.x.x" /> | |
remove_action('wp_head', 'wp_generator'); | |
// Remove the EditURI/RSD | |
// Like: <link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://localhost/wp/xmlrpc.php?rsd" /> | |
remove_action ('wp_head', 'rsd_link'); | |
// Remove it if you don't know what is Windows Live Writer | |
// <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://localhost/wp/wp-includes/wlwmanifest.xml" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ---------------------------------------------------------------------- | |
# CORS-enabled images (@crossorigin) | |
# ---------------------------------------------------------------------- | |
# Send CORS headers if browsers request them; enabled by default for images. | |
# developer.mozilla.org/en/CORS_Enabled_Image | |
# blog.chromium.org/2011/07/using-cross-domain-images-in-webgl-and.html | |
# hacks.mozilla.org/2011/11/using-cors-to-load-webgl-textures-from-cross-domain-images/ | |
# wiki.mozilla.org/Security/Reviews/crossoriginAttribute | |
<IfModule mod_setenvif.c> | |
<IfModule mod_headers.c> |
OlderNewer