Skip to content

Instantly share code, notes, and snippets.

@deeman
deeman / function.php
Created October 24, 2017 16:55
WooCommerce. Single product. Remove Additional Information
/**
* remove on single product panel 'Additional Information' since it already says it on tab.
*/
add_filter('woocommerce_product_additional_information_heading', 'isa_product_additional_information_heading');
function isa_product_additional_information_heading() {
echo '';
}
@deeman
deeman / functions.php
Last active January 11, 2019 12:48
Genesis: Enqueue Ion Icons In Genesis
add_action( 'wp_enqueue_scripts', 'load_ionicons' );
function load_ionicons() {
wp_enqueue_style( 'genesis-ionicons', '//code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css', array(), CHILD_THEME_VERSION );
}
@deeman
deeman / remove-entry-title.php
Last active January 13, 2019 14:33
Genesis Framework - How to remove entry title
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Remove entry title in entry header (requires HTML5 theme support)
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
@deeman
deeman / functions.php
Last active January 27, 2019 11:16
Enqueue the Dashicons script
//Enqueue the Dashicons script
add_action( 'wp_enqueue_scripts', 'load_dashicons_front_end' );
function load_dashicons_front_end() {
wp_enqueue_style( 'dashicons' );
}
@deeman
deeman / functions.php
Last active February 26, 2019 00:27
Admin Login to WooCommerce Product-area
// Login direct to the Product area in Admin Back-end
add_action( 'load-index.php', 'woo_direct_access_wp_dashboard_redirect' );
function woo_direct_access_wp_dashboard_redirect(){
wp_redirect( admin_url( 'edit.php?post_type=product' ) );
}
add_filter( 'login_redirect', 'woo_login_wp_dashboard_redirect', 9999, 3 );
function woo_login_wp_dashboard_redirect( $redirect_to, $request, $user ){
@deeman
deeman / functions.php
Last active February 27, 2019 11:10
Google Tag Manger (WordPress)
<!--
/* Step 1 - Get Your Google Tag Manager Code*/
-->
add_action('wp_head','my_analytics', 20);
function my_analytics() {
?>
<!-- Replace thi with first GTM code -->
<?php
@deeman
deeman / functions.php
Created March 1, 2019 09:20
[WooCommerce] - Remove Sales Flash
//WOOCOMMERCE REMOVE SALES FLASH
remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 10 );
remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_sale_flash', 10 );
@deeman
deeman / deny PHP uploads
Created March 18, 2019 10:32
[WordPress][Security] Deny PHP uploads
#Deny PHP uploads
#Create A .htaccess-file in dir /wp-content/uploads AND /wp-includes
#Copy/Paste code below and save:
<Files *.php>
deny from all
</Files>
@deeman
deeman / enable HSTS
Last active March 18, 2019 10:34
[WordPress][Security] Enable HSTS - HTTP Strict Transport Security in .htaccess
<IfModule mod_headers.c>
Header set Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
</IfModule>
#Alternative
<IfModule mod_headers.c>
Header set Strict-Transport-Security "max-age=31536000" env=HTTPS
</IfModule>
@deeman
deeman / wordpress-disable-emojis
Created March 18, 2019 12:02
[WordPress] Disable Emoji's
/**
* Disable the emoji's
*/
function disable_emojis() {
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );
remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );