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 strip_img_hwattr($html) { | |
return preg_replace('/(width|height)=\"\d+\"\s/','',$html); | |
} | |
add_filter('post_thumbnail_html','strip_img_hwattr',100); |
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
# append to existing .htaccess | |
# PHP Settings http://www.rackspace.com/knowledge_center/product-faq/cloud-sites | |
php_value memory_limit 512M | |
php_value upload_max_filesize 32M | |
php_value post_max_size 32M | |
php_value max_execution_time 200 | |
php_value max_input_time 200 |
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
// Anywhere in the wp-config.php before the last include | |
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST']); | |
define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST']); | |
define('DOMAIN_CURRENT_SITE', $_SERVER['HTTP_HOST']); |
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
#!/bin/bash | |
# Get your credentials set in your environment before you run: | |
# export BB_USER="my_username" | |
# export BB_P="MySERCRETP4ss" | |
# export BB_OWNER="my_username_or_team" | |
for f in $(find -type d -path '.*git' |cut -d'.' -f2|sed 's:/::g'); do | |
g=$(curl -s -u $BB_USER:$BB_P "https://bitbucket.org/api/1.0/repositories/$BB_OWNER/$f") | |
rg=$(echo "$g" | grep -c error) |
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
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script> | |
<script> | |
if (window.location.hash == '#_=_') // Darn it, Facebook | |
window.location.hash = ''; | |
$(document).bind("mobileinit", function(){ | |
// Enable anchor links to behave like you think they would | |
$(document).on('pagechange',function(e,ui){ | |
$('a[href^="#"]',ui.toPage).on('click',function(){ | |
var selector = 'a[name="'+($(this).attr('href').substring(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
-- Make sure ZZZ is the number of the site in the `wp_sites` table. Your root site has no entry so it would be `wp_posts` | |
-- but your first site in the Network Admin > Sites list would be `wp_1_posts` | |
-- OLDSITE.TLD and NEWSITE.TLD should be complete FQDNs. If a site was www.olddomain.com make sure you replace it | |
-- completely so that you don't end up with www.www.newsite.com | |
UPDATE wp_ZZZ_postmeta SET meta_value = replace(meta_value,'OLDSITE.TLD','NEWSITE.TLD') WHERE meta_value like '%OLDSITE.TLD%'; | |
UPDATE wp_ZZZ_posts SET guid = replace(guid, 'OLDSITE.TLD','NEWSITE.TLD'); | |
UPDATE wp_ZZZ_posts SET post_content = replace(post_content, 'OLDSITE.TLD','NEWSITE.TLD'); | |
-- Close comments on all existsing posts and pages | |
UPDATE wp_ZZZ_posts SET ping_status = 'closed', comment_status = 'closed' WHERE post_type IN ('post,'page'); |
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
<!DOCTYPE html> | |
<head> | |
<style> | |
.event_wrap {border: 1px solid #ddd; padding: 10px;margin: 20px} | |
span.clear-filter {text-decoration:underline;background-color:blue;cursor:pointer;color:white;margin-left:5px} | |
.current-tax {font-weight:bold} | |
</style> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-2.0.0.js"></script> | |
<script> | |
(function ($) { |
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 | |
/* | |
If you don't know a user_id of an admin, find one with $wpdb->query(): | |
SELECT user_id,meta_value FROM {$wpdb->prefix}usermeta WHERE meta_key = 'nickname' | |
AND user_id IN | |
(SELECT user_id FROM {$wpdb->prefix}usermeta WHERE meta_value LIKE '%administrator%'); | |
+---------+------------+ | |
| user_id | meta_value | |
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 | |
/* | |
Plugin Name: MU Clear Permalinks | |
Plugin URI: https://gist.github.com/dalethedeveloper/5492196 | |
Description: Clear all site permalinks when Update Network is used | |
Author: dalethedeveloper | |
Version: 0.1 | |
*/ | |
if( ! function_exists('rhplive_clear_permalinks') ): |
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 $post; | |
$which_parent = empty($post->post_parent) ? get_the_ID() : $post->post_parent; | |
if( is_page() and get_children('post_status=publish&post_type=page&numberposts=1&post_parent='.$which_parent) ): | |
?> | |
<li id="widget-child-nav" class="widget"> | |
<a href="<?php echo get_permalink($which_parent); ?>"> | |
<h2 class="widgettitle"><?php echo get_the_title($which_parent); ?> Menu</h2> | |
</a> | |
<ul> |