Skip to content

Instantly share code, notes, and snippets.

View baczoni's full-sized avatar

Aron Baczoni baczoni

View GitHub Profile
@baczoni
baczoni / gist:2480022
Created April 24, 2012 14:13
Wordpress: Remove version info from head and feeds
<?php
// remove version info from head and feeds
function complete_version_removal() {
return '';
}
add_filter('the_generator', 'complete_version_removal');
@baczoni
baczoni / gist:2480003
Created April 24, 2012 14:11
Wordpress: Add favicon to your site
// 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');
@baczoni
baczoni / gist:2479987
Created April 24, 2012 14:10
Wordpress: Page specific css and javascript
//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 }
@baczoni
baczoni / gist:2479976
Created April 24, 2012 14:08
Wordpress: Remove nofollow from comments
// 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');
@baczoni
baczoni / gist:2479916
Created April 24, 2012 14:05
Wordpress: Change excerpt length
//Change Excerpt Length -- Add to functions.php
function new_excerpt_length($length) {
return 35; //Change word count
}
add_filter('excerpt_length', 'new_excerpt_length');