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
//Change Excerpt Length -- Add to functions.php | |
function new_excerpt_length($length) { | |
return 35; //Change word count | |
} | |
add_filter('excerpt_length', 'new_excerpt_length'); |
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 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 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
//Page specific css and/or javascript -- Add to header.php | |
if (is_page_template('page-archives.php')) { ?> | |
<link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/css/ archives.css" type="text/css" media="screen" /> | |
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/ js/archives.js"></script> | |
<?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
// add a favicon to your | |
function blog_favicon() { | |
echo '<link rel="Shortcut Icon" type="image/x-icon" href="'.get_bloginfo('wpurl').'/favicon.ico" />'; | |
} | |
add_action('wp_head', 'blog_favicon'); |
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 version info from head and feeds | |
function complete_version_removal() { | |
return ''; | |
} | |
add_filter('the_generator', 'complete_version_removal'); |
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 | |
global $current_user; | |
get_currentuserinfo(); | |
$user_id = $current_user->ID; // You can set $user_id to any users, but this gets the current users ID. | |
$user_twitter = get_user_meta( $user_id, 'twitter', true); | |
echo $user_twitter; | |
?> |
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 | |
function new_contactmethods( $contactmethods ) { | |
$contactmethods['twitter'] = 'Twitter'; // Add Twitter | |
$contactmethods['facebook'] = 'Facebook'; // Add Facebook | |
unset($contactmethods['yim']); // Remove YIM | |
unset($contactmethods['aim']); // Remove AIM | |
unset($contactmethods['jabber']); // Remove Jabber | |
return $contactmethods; | |
} |
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 | |
/* | |
Template Name: Name of your Template | |
*/ | |
?> |
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 | |
function custom_login_logo() { | |
echo '<style type="text/css"> | |
h1 a { background-image:url('.get_bloginfo('template_directory').'/images/login_logo.png) !important; } | |
</style>'; | |
} | |
add_action('login_head', 'custom_login_logo'); | |
?> |
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 to wp-config.php file ** | |
<?php | |
# Maximum 5 revisions # | |
define('WP_POST_REVISIONS', 5); | |
# Disable revisions # | |
define('WP_POST_REVISIONS', false); | |
?> |
OlderNewer