This file contains hidden or 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_filter('comment_form_default_fields', 'unset_url_field'); | |
| function unset_url_field($fields){ | |
| if(isset($fields['url'])) | |
| unset($fields['url']); | |
| return $fields; | |
| } |
This file contains hidden or 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
| function is_old_post($days = 5) { | |
| $days = (int) $days; | |
| $offset = $days*60*60*24; | |
| if ( get_post_time() < date('U') - $offset ) | |
| return true; | |
| return false; | |
| } | |
| //To be included in the loop | |
| if ( is_old_post(10) ) { |
This file contains hidden or 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 edit_post_link(__('Edit This')); ?> |
This file contains hidden or 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 | |
| global $current_user; | |
| get_currentuserinfo(); | |
| echo get_avatar( $current_user->ID, 64 ); | |
| ?> |
This file contains hidden or 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 highlight the term that was searched in search results, open up search.php and replace the_title(); with echo $title;. Above this line add the following code. | |
| <?php | |
| $title = get_the_title(); | |
| $keys= explode(" ",$s); | |
| $title = preg_replace('/('.implode('|', $keys) .')/iu', | |
| '<strong class="search-excerpt">�</strong>', | |
| $title); | |
| ?> |
This file contains hidden or 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 nofollow from comments | |
| function xwp_dofollow($str) { | |
| $str = preg_replace( | |
| '~<a ([^>]*)s*(["|']{1}w*)s*nofollow([^>]*)>~U', | |
| '<a ${1}${2}${3}>', $str); | |
| return str_replace(array(' rel=""', " rel=''"), '', $str); | |
| } | |
| remove_filter('pre_comment_content', 'wp_rel_nofollow'); | |
| add_filter ('get_comment_author_link', 'xwp_dofollow'); | |
| add_filter ('post_comments_link', 'xwp_dofollow'); |
This file contains hidden or 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 post content | |
| function add_post_content($content) { | |
| if(!is_feed() && !is_home()) { | |
| $content .= '<p>This article is copyright © '.date('Y').' '.bloginfo('name').'</p>'; | |
| } | |
| return $content; | |
| } | |
| add_filter('the_content', 'add_post_content'); |
This file contains hidden or 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 feed content | |
| function add_feed_content($content) { | |
| if(is_feed()) { | |
| $content .= '<p>This article is copyright © '.date('Y').' '.bloginfo('name').'</p>'; | |
| } | |
| return $content; | |
| } | |
| add_filter('the_excerpt_rss', 'add_feed_content'); | |
| add_filter('the_content', 'add_feed_content'); |
This file contains hidden or 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_action('init', 'wp_admin_bar_init'); | |
| OR | |
| show_admin_bar(false); |