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
//disable auto updating of WP since 3.7 | |
//Disables all core updates: | |
define( 'WP_AUTO_UPDATE_CORE', false ); | |
//Enables all core updates, including minor and major: | |
define( 'WP_AUTO_UPDATE_CORE', true ); | |
//Enables core updates for minor releases (default): | |
define( 'WP_AUTO_UPDATE_CORE', 'minor' ); | |
//only disable updating of the wp.content folder, i.e. no themes and default plugins like akismet and hello dolly |
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
function wpr_snap($atts, $content = null) { | |
extract(shortcode_atts(array( | |
"snap" => 'http://s.wordpress.com/mshots/v1/', | |
"url" => 'http://www.sagive.co.il', | |
"alt" => 'My image', | |
"w" => '400', // width | |
"h" => '300' // height | |
), $atts)); | |
$img = '<img src="' . $snap . '' . urlencode($url) . '?w=' . $w . '&h=' . $h . '" alt="' . $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
//add discreet text widget | |
add_action('widgets_init', 'custom_discreet_text_widget'); | |
function custom_discreet_text_widget() { | |
class DiscreetTextWidget extends WP_Widget_Text { | |
function DiscreetTextWidget() { | |
$widget_ops = array('classname' => 'discreet_text_widget', 'description' => __('Arbitrary text or HTML, only shown if not empty')); | |
$control_ops = array('width' => 400, 'height' => 350); | |
$this->WP_Widget('discrete_text', __('Discreet Text'), $widget_ops, $control_ops); | |
} |
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
//added by Ovi Custom CSS Widget | |
add_action('admin_menu', 'custom_css_hooks'); | |
add_action('save_post', 'save_custom_css'); | |
add_action('wp_head','insert_custom_css'); | |
//added by Ovi custom CSS Widget, edit below to add to more than posts or pages | |
function custom_css_hooks() { | |
add_meta_box('custom_css', 'Custom CSS', 'custom_css_input', 'post', 'normal', 'high'); | |
add_meta_box('custom_css', 'Custom CSS', 'custom_css_input', 'page', 'normal', 'high'); | |
} |
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
//run before wpautop | |
add_filter( 'the_content', 'my_aside_to_infinity_and_beyond', 9 ); | |
function my_aside_to_infinity_and_beyond( $content ) { | |
if ( has_post_format( 'aside' ) && !is_singular() ) | |
$content .= ' <a href="' . get_permalink() . '">∞</a>'; | |
return $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
// set the default feed to atom | |
add_filter('default_feed','atom_default_feed'); | |
function atom_default_feed() { return 'atom'; } | |
// remove the rdf and rss 0.92 feeds (nobody ever needs these) | |
remove_action( 'do_feed_rdf', 'do_feed_rdf', 10, 1 ); | |
remove_action( 'do_feed_rss', 'do_feed_rss', 10, 1 ); | |
// point those feeds at rss 2 (it is backwards compatible with both of them) | |
add_action( 'do_feed_rdf', 'do_feed_rss2', 10, 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
/* Automatically link Twitter usernames in WordPress*/ | |
function twtreplace($content) { | |
return preg_replace('/([^a-zA-Z0-9-_&])@([0-9a-zA-Z_]+)/', "$1<a href=\"http://twitter.com/$2\" target=\"_blank\" rel=\"nofollow\">@$2</a>", $content); | |
} | |
add_filter('the_content', 'twtreplace'); | |
add_filter('comment_text', 'twtreplace'); |
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 implement, simply include this script at the top of your theme’s 404.php file. | |
//If your theme don’t have a 404.php file, then create it. | |
<?php // WP 404 ALERTS @ http://wp-mix.com/wordpress-404-email-alerts/ | |
// set status | |
header("HTTP/1.1 404 Not Found"); | |
header("Status: 404 Not Found"); | |
// site info |
NewerOlder