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 Custom Content After All WordPress Posts By http://goo.gl/ht6fZo | |
*/ | |
function add_after_post_content($content) { | |
if(!is_feed() && !is_home() && is_singular() && is_main_query()) { | |
$content .= '<p>YOUR CONTENT AFTER POST</p>'; | |
} | |
return $content; | |
} | |
add_filter('the_content', 'add_after_post_content'); |
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 rel=”nofollow” To WordPress Comment Reply Links By http://goo.gl/ht6fZo// | |
function add_nofollow_to_reply_link( $link ) { | |
return str_replace( '")\'>', '")\' rel=\'nofollow\'>', $link ); | |
} | |
add_filter( 'comment_reply_link', 'add_nofollow_to_reply_link' ); |
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
/** | |
* Stop Search Engines From Indexing Search ResultsBy http://goo.gl/ht6fZo// | |
*/ | |
<?php if(is_search()) { ?> | |
<meta name="robots" content="noindex, nofollow" /> | |
<?php }?> |
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 Stop Words from URL By http://goo.gl/ht6fZo// | |
*/ | |
add_filter('sanitize_title', 'remove_stop_words'); | |
function remove_stop_words($slug) { | |
if (!is_admin()) return $slug; | |
$slug = explode('-', $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
/** | |
* Show Top Commenters On WordPress Blog By http://goo.gl/ht6fZo | |
*/ | |
function top_comment_authors($amount = 5) { | |
global $wpdb; | |
$results = $wpdb->get_results(' | |
SELECT | |
COUNT(comment_author_email) AS comments_count, comment_author_email, comment_author, comment_author_url | |
FROM '.$wpdb->comments.' | |
WHERE comment_author_email != "" AND comment_type = "" AND comment_approved = 1 |
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
//Minimum Comment Limit In WordPress by http://goo.gl/ht6fZo// | |
add_filter( 'preprocess_comment', 'minimal_comment_length' ); | |
function minimal_comment_length( $commentdata ) { | |
$minimalCommentLength = 15; | |
if ( strlen( trim( $commentdata['comment_content'] ) ) < $minimalCommentLength ) | |
{ | |
wp_die( 'All comments must be at least ' . $minimalCommentLength . ' characters long.' ); | |
} |
NewerOlder