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_filter('wp_list_categories', 'esc_wp_rel_nofollow'); | |
add_filter('wp_tag_cloud', 'esc_wp_rel_nofollow'); | |
function esc_wp_rel_nofollow($output) | |
{ | |
if (is_single() || is_category() || is_tag()) | |
return stripslashes(wp_rel_nofollow($output)); | |
return $output; |
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 | |
/** | |
* thim functions and definitions | |
* | |
* @package thim | |
*/ | |
define( 'THIM_DIR', trailingslashit( get_template_directory() ) ); | |
define( 'THIM_URI', trailingslashit( get_template_directory_uri() ) ); | |
define( 'THIM_THEME_VERSION', '3.4.3' ); |
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 | |
/* | |
* Use this funtion to delete the custom post type registered by the plugin "Essential Grid" | |
* Alternative method to the one proposed by plugin authors: | |
* https://www.themepunch.com/faq/hide-ess-grid-posts-custom-post-type-from-wp-main-menu/ | |
* | |
* Usage for other CPT: Replace 'essential_grid' with the slug of the custom post type | |
* | |
* Sources: | |
* https://gist.github.com/johnkolbert/769160 |
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 IP collection in WordPress comments | |
* Source: http://www.wpbeginner.com/wp-tutorials/how-to-stop-storing-ip-address-in-wordpress-comments/ | |
*/ | |
function wpb_remove_commentsip( $comment_author_ip ) { | |
return ''; | |
} | |
add_filter( 'pre_comment_user_ip', 'wpb_remove_commentsip' ); |
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 WordPress emojis | |
* Source: https://kinsta.com/knowledgebase/disable-emojis-wordpress/#disable-emojis-code | |
*/ | |
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' ); |
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 version information from being displayed in the header or RSS feed | |
* | |
* Sources: | |
* http://torquemag.io/2016/06/keep-your-wordpress-site-safe-with-these-four-tips/ | |
*/ | |
function disable_version_info() { |
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
# Custom Security Measures by @voneff | |
# | |
# Sources: | |
# @link https://gist.github.com/voneff/f66128aaacd350294e8a | |
# @link https://premium.wpmudev.org/blog/keeping-wordpress-secure-the-ultimate-guide | |
# @link https://kinsta.com/blog/wp-config-php/ | |
# @link https://kittpress.com/wordpress-sicherheit-2-erste-konfiguration/ | |
# | |
# Turn Off PHP Error Reporting: |
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 | |
/** | |
* Plugin Name: WP Rocket | UnLazyLoad Essential Grid | |
* Description: Disables WP Rocket’s LazyLoad feature on pages with <a href="https://www.themepunch.com/portfolio/essential-grid-wordpress-plugin/">Essential Grid</a>. | |
* Author: WP Rocket Support Team | |
* Author URI: http://wp-rocket.me/ | |
* Plugin URI: http://docs.wp-rocket.me/article/139-disable-lazyload-on-mobile#inactive | |
* License: GNU General Public License v3 or later | |
* License URI: http://www.gnu.org/licenses/gpl-3.0.html | |
*/ |
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 | |
/** | |
* WP Rocket: | |
* 1. Customise order of minification and defer operations. | |
* 2. Exclude file from defer JS only (still minified). | |
* | |
* Tested rudimentary with WP Rocket 2.11.7 and 3.0.x. | |
* Test before using this in production! | |
*/ | |
add_action( 'wp_rocket_loaded', function () { |
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 | |
// Retrieved from: http://wp-snippets.com/disable-self-trackbacks/ | |
add_action( 'pre_ping', 'disable_self_ping' ); | |
function disable_self_ping( &$links ) { | |
foreach ( $links as $l => $link ) | |
if ( 0 === strpos( $link, get_option( 'home' ) ) ) | |
unset($links[$l]); | |
} |