View transfer_process.sql
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');
View getObjectSize.js
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;
}
View email_on_post.php
<?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);
View register_new_sidebar.php
<?php
/**
* Location: functions.php
*/
// callback function
function your_widget_display() {
// print some HTML for the widget to display here
echo "Your Widget Test";
}
View custom_post_thumb_size.php
<?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)
View custom_post_formats.php
<?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',
View custom_nav_menus.php
<?php
/**
* Location: funtions.php
*
*/
// Registering in functions.php
if ( function_exists( 'register_nav_menus' ) ) {
register_nav_menus(
array(
View custom_taxes_and_posts.php
<?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:
View async-script.js
<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) {
View facebook.share.html
<a id="fb-share-popup" href="http://www.facebook.com/sharer.php?s=100&amp;p[title]=____&amp;p[url]=____&amp;p[summary]=____&amp;p[images][0]=____" target="_blank">share on Facebook</a>
<script>
// This will open our link in a new, small window in the middle of the browser
var p = {};
p.w = 700;
p.h = 400;
p.l = (screen.width/2)-(p.w/2);
p.t = (screen.height/2)-(p.h/2);