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
/* | |
This code adds a hidden text field to the comment form to trap spam bots. | |
Add these code snippet at the end of functions.php. | |
No other setting needed. | |
*/ | |
//Add an invisible field to comment form box | |
add_action('comment_form', 'wpp_add_honeypot'); | |
function wpp_add_honeypot($postID) { | |
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
To block readme.html add this to .htaccess file: | |
<files readme.html> | |
order allow,deny | |
deny from all | |
</files> | |
Repeat it for other files as needed. |
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
/*remove wordpress version number from front-end pages*/ | |
function remove_version_from_mysite() { | |
return ''; | |
} | |
add_filter('the_generator','remove_version_from_mysite'); |
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
//* Remove Comment Form Website URL Field | |
add_filter('comment_form_default_fields','wpp_remove_comment_url'); | |
function wpp_remove_comment_url($fields) { | |
unset($fields['url']); | |
return $fields; | |
} | |
//* Remove comment form allowed tags | |
add_filter( 'comment_form_defaults', 'wpp_remove_comment_form_allowed_tags' ); | |
function wpp_remove_comment_form_allowed_tags( $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
/*Include a file from Child Theme Directory*/ | |
<?php require_once( get_stylesheet_directory(). '/functions/child_theme_include_file.php' ); ?> | |
/*Include a file from Parent Theme Directory*/ | |
<?php require_once( get_template_directory(). '/functions/parent_theme_include_file.php' ); ?> | |
/*Include a image from Child Theme Directory*/ | |
<img src="<?php echo get_stylesheet_directory_uri(); ?>/images/my_picture.png" alt="" /> |
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
/* | |
Theme Name: Twenty Fifteen Child | |
Theme URI: http://example.com/ | |
Description: Child theme for the Twenty Fifteen theme | |
Author: Your name here | |
Author URI: http://example.com/about/ | |
Template: twentyfifteen | |
Version: 0.1.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
<?php | |
/* | |
Plugin Name: Site Plugin for mysite.com | |
Version: 1.0 | |
Author: Your Name | |
Description: Custom functions for mysite.com | |
*/ | |
/* Start Adding Functions Below this Line */ |
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
//Automatically Insert Google Adsense ads to the top left or right of each post content. | |
add_filter( 'the_content', 'wpp_insert_ads_to_content' ); | |
function wpp_insert_ads_to_content( $content ) { | |
$ad_code_wrapper_start = '<div style=”display:block;float:right;margin: 0px 0px 0px 10px;”>'; | |
$ad_code = ' Copy and Paste Ad sense code here. Do not remove the starting and ending single quotes '; | |
$ad_code_wrapper_end = '</div>'; | |
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
<div style="float:right;position:relative;left:-50%;text-align:center;"> | |
<div style="position:relative;left:50%;"> | |
<!--125x125 Ad Banner Block#1--> | |
<a href="http://www.google.com" target=_blank> | |
<img src="http://localhost/wp-content/uploads/2015/07/a.png" alt="Google Banner" width="125" height="125" rel="nofollow" /> | |
</a> | |
<!--125x125 Ad Banner Block#2--> | |
<a href="http://yahoo.com" target=_blank> |
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
<div style="float:right;position:relative;left:-50%;text-align:center;"> | |
<div style="position:relative;left:50%;"> | |
<!--125x125 Ad Banner#1--> | |
<a href="target link here" target=_blank> | |
<img src="File URL of ad banner image here" alt="alt txt for ad 1" width="125" height="125" rel="nofollow" /> | |
</a> | |
<!--125x125 Ad Banner#2--> | |
<a href="target link here" target=_blank> |
NewerOlder