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
add_filter( 'body_class', 'body_class_example' ); | |
function body_class_example( $classes ) { | |
if( is_single() ) { | |
foreach( get_the_category( get_the_ID() ) as $category ) | |
$classes[] = 'cat-' . $category->category_nicename; | |
} | |
return $classes; | |
} |
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
# WP Security | |
# PROTECTING DIRECTORIES | |
Options -Indexes | |
#IndexIgnore *.php | |
# WHITELISTING IP ADDRESSES | |
<Files wp-login.php> | |
#Order Deny,Allow | |
#Deny from all | |
# Allow access via this IP address |
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
/* | |
* @seen on https://css-tricks.com/snippets/sass/centering-mixin/ | |
*/ | |
@mixin center($horizontal: true, $vertical: true) { | |
position: absolute; | |
@if ($horizontal and $vertical) { | |
top: 50%; | |
left: 50%; | |
transform: translate(-50%, -50%); |
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
// Title Border | |
// Apply a short border beneath a title | |
// Usage @mixin title-border(color); | |
@mixin title-border($color, $height, $width, $position) { | |
@if $position == center { | |
$position: 0 auto; | |
} @else { | |
$position: 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
// ------------------------------------------------------------ | |
// Font Stacks | |
// ------------------------------------------------------------ | |
// Example Font Stack Usage | |
// @include font(light); | |
// @include font(body); | |
// @include font(medium); | |
// @include font(semibold); | |
// @include font(bold); |
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
/* | |
About: CSS (SCSS) Tooltips | |
Author: https://twitter.com/_uloga | |
*/ | |
$success: #2AA583 !default; | |
$info: #15a3ff !default; | |
$warning: #F3AB44 !default; | |
$danger: #EE4D3B !default; |
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
/* | |
* Change the "Proceed to PayPal" button text in the WooCommerce checkout screen | |
*/ | |
add_filter( 'gettext', 'rb_custom_paypal_button', 20, 3 ); | |
function rb_custom_paypal_button( $translated_text, $text, $domain ) { | |
switch ( $translated_text ) { | |
case 'Proceed to PayPal' : | |
$translated_text = __( 'Your new Paypal button text here', 'woocommerce' ); | |
break; | |
} |
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
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 ); | |
function woo_remove_product_tabs( $tabs ) { | |
unset( $tabs['description'] ); // Remove the description tab | |
unset( $tabs['reviews'] ); // Remove the reviews tab | |
unset( $tabs['additional_information'] ); // Remove the additional information tab | |
return $tabs; |
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
add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 ); | |
function woo_rename_tabs( $tabs ) { | |
$tabs['description']['title'] = __( 'More Information' ); // Rename the description tab | |
$tabs['reviews']['title'] = __( 'Ratings' ); // Rename the reviews tab | |
$tabs['additional_information']['title'] = __( 'Product Data' ); // Rename the additional information tab | |
return $tabs; | |
} |
OlderNewer