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 | |
//* 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 | |
//* Remove X-Pingback header | |
add_filter( 'wp_headers', function( $headers ) { | |
unset( $headers['X-Pingback'] ); | |
return $headers; | |
}, 20); | |
//* Remove XML-RPC methods | |
add_filter( 'xmlrpc_methods', function( $methods ) { | |
unset( $methods['pingback.ping'] ); |
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 | |
//* Changed file: controllers/admin/import.php ************************************************************************************ | |
//* OLD: | |
$hide_fields = array('_wp_page_template', '_edit_lock', '_edit_last', '_wp_trash_meta_status', '_wp_trash_meta_time'); | |
//* NEW: | |
$hide_fields = array('_edit_lock', '_edit_last', '_wp_trash_meta_status', '_wp_trash_meta_time'); |
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 | |
//* Load Google charts library | |
add_action( 'wp_enqueue_scripts', 'wp_enqueue_chiptuning_scripts' ); | |
function wp_enqueue_chiptuning_scripts( ) { | |
wp_enqueue_script( 'google-charts-script', 'https://www.gstatic.com/charts/loader.js' ); | |
} | |
//* Replace Genesis loop | |
remove_action( 'genesis_loop', 'genesis_do_loop' ); |
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 | |
//* Highlight parent menu item | |
add_action('nav_menu_css_class', 'nl_nav_menu_css_class', 10, 2 ); | |
function nl_nav_menu_css_class($classes, $item) { | |
global $post; | |
$current_post_type = get_post_type_object(get_post_type($post->ID)); | |
$current_post_type_slug = $current_post_type->rewrite['slug']; |
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 page slug as id to widget title | |
add_filter('widget_title', 'add_slug_id_to_widget_title', 15, 3); | |
function add_slug_id_to_widget_title($title, $instance, $args){ | |
$page = get_page_by_title($title); | |
$title = sprintf('<span id="%s">%s</span>', $page->post_name, $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
# Ignore everything in the root except the "wp-content" directory, the config | |
# fies and the meta files. | |
/* | |
.* | |
~* | |
!wp-content/ | |
!.gitignore | |
!.htaccess | |
!.htpasswd | |
!README.md |
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 | |
//* Disable the emoji's | |
add_action( 'init', 'nl_disable_wp_emojis' ); | |
function nl_disable_wp_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' ); |
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 | |
//* Disable embed script | |
add_action('init', 'nl_disable_wp_embed'); | |
function nl_disable_wp_embed() { | |
if (!is_admin()) { | |
wp_deregister_script('wp-embed'); | |
} | |
} |