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
update wp_options set option_value = replace(option_value,'string_to_find','string_to_replace'); | |
update wp_posts set guid = replace(guid,'string_to_find','string_to_replace'); |
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 objectSize(the_object) { | |
/* function to validate the existence of each key in the object to get the number of valid keys. */ | |
var object_size = 0; | |
for (key in the_object){ | |
if (the_object.hasOwnProperty(key)) { | |
object_size++; | |
} | |
} | |
return object_size; | |
} |
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 email_members($post_ID) { | |
global $wpdb; | |
// fetch the list of users registered | |
foreach( $wpdb->get_results("SELECT user_email FROM $wpdb->users;") as $key => $object) { | |
$user_emails[] = $object->user_email; | |
} | |
$users = implode(',', $user_emails); |
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 | |
/** | |
* Location: functions.php | |
* | |
*/ | |
// drop in functions.php | |
if ( function_exists( 'add_theme_support' ) ) { | |
add_theme_support( 'post-thumbnails' ); | |
add_theme_support( 'post-thumbnails', array('post', 'movie')); // include array of post_types (including registered ones) |
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 | |
/** | |
* Location: functions.php | |
* | |
*/ | |
// comment out as necessary | |
// use for styling 'format-{type}' class generated from post_class() in the loop | |
if ( function_exists( 'add_theme_support' ) ) { | |
add_theme_support('post-formats', |
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 //http://codex.wordpress.org/Function_Reference/register_post_type#Example | |
/** | |
* Base-settings for adding additional features to an existing WP install | |
* | |
* Location: functions.php file | |
* | |
* | |
* | |
* It's best to play around with the setting below, but this | |
* basic structure allows for: |
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 type="text/javascript"> | |
// Add a script element as a child of the body | |
function downloadJSAtOnload() { | |
var script = document.createElement("script"); | |
script.src = "script.js"; | |
document.body.appendChild(script); | |
} | |
// Check for browser support of event handling capability | |
if (window.addEventListener) { |
OlderNewer