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
<?php | |
//* Add link shortcode to widget title | |
//* Usage: [link href = https://www.google.com]Google[link] | |
add_filter( 'widget_title', 'link_widget_title' ); | |
function link_widget_title( $title ) { | |
$title = str_replace( '[link', '<a', $title ); | |
$title = str_replace( '[/link]', '</a>', $title ); | |
$title = str_replace( ']', '>', $title ); | |
return $title; |
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
<?php | |
//* Trim length of featured post title | |
add_filter( 'genesis_featured_post_title', 'smntcs_genesis_featured_post_title' ); | |
function smntcs_genesis_featured_post_title( $title ) { | |
return mb_strimwidth($title, 0, 65, '...'); | |
} |
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
<?php | |
//* Hide all login errors | |
add_filter( 'login_errors', 'nl_hide_login_errors' ); | |
function nl_hide_login_errors(){ | |
return null; | |
} |
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
<?php | |
//* Add taxomonies to page | |
add_action( 'init', 'nl_add_taxonomies_to_pages' ); | |
function nl_add_taxonomies_to_pages() { | |
register_taxonomy_for_object_type( 'post_tag', 'page' ); | |
register_taxonomy_for_object_type( 'category', 'page' ); | |
} |
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
<?php | |
//* Enhance customizer | |
add_action( 'customize_register', 'nl_enhance_customizer' ); | |
function nl_enhance_customizer( $wp_customize ) { | |
$wp_customize->add_section( | |
'footer_section', | |
array( | |
'title' => __('Title of the settings box', 'theme_name'), | |
'description' => __('Description of the settings box'), | |
'priority' => 150, |
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
<?php | |
//* Hide admin bar | |
add_filter('show_admin_bar', '__return_false'); |
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
<?php | |
/** | |
* Add a 1% surcharge to your cart / checkout | |
* change the $percentage to set the surcharge to a value to suit | |
* Uses the WooCommerce fees API | |
* | |
* Add to theme functions.php | |
*/ | |
add_action( 'woocommerce_cart_calculate_fees','woocommerce_custom_surcharge' ); | |
function woocommerce_custom_surcharge() { |
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
<?php | |
//* Change breadcrumb home text | |
add_filter( 'woocommerce_breadcrumb_defaults', 'nl_change_breadcrumb_home_text' ); | |
function nl_change_breadcrumb_home_text( $defaults ) { | |
$defaults['home'] = 'Start'; | |
return $defaults; | |
} |
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
<?php | |
//* Change the breadcrumb separator from '/' to '»' | |
add_filter( 'woocommerce_breadcrumb_defaults', 'nl_change_breadcrumb_delimiter' ); | |
function nl_change_breadcrumb_delimiter( $defaults ) { | |
$defaults['delimiter'] = ' » '; | |
return $defaults; | |
} |
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
# Ignore everything in the root except the "wp-content" directory, the config | |
# fies and the meta files. | |
/* | |
.* | |
~* | |
!wp-content/ | |
!.gitignore | |
!.htaccess | |
!.htpasswd | |
!README.md |