This file contains hidden or 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
# Change URL in Content | |
UPDATE wp_posts SET post_content = REPLACE (post_content, 'http://www.oldsiteurl.com', 'http://www.newsiteurl.com'); |
This file contains hidden or 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
# Change GUID | |
UPDATE wp_posts SET guid = REPLACE (guid, 'http://www.oldsiteurl.com', 'http://www.newsiteurl.com'); |
This file contains hidden or 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
# Change Siteurl & Homeurl | |
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldsiteurl.com', 'http://www.newsiteurl.com') WHERE option_name = 'home' OR option_name = 'siteurl'; |
This file contains hidden or 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
# Reset Password | |
UPDATE wp_users SET user_pass = MD5( 'new_password' ) WHERE user_login = 'your-username'; |
This file contains hidden or 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
# Change Default "Admin" Username | |
UPDATE wp_users SET user_login = 'Your New Username' WHERE user_login = 'Admin'; |
This file contains hidden or 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 | |
/** | |
* Enable debug mode | |
* | |
* Usage: | |
* http://example.com?debug=debug | |
*/ | |
if ( isset($_GET['debug']) && $_GET['debug'] == 'debug') | |
define('WP_DEBUG', true); | |
?> |
This file contains hidden or 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 | |
/** | |
* Set default editor | |
*/ | |
# This sets the Visual Editor as default # | |
add_filter( 'wp_default_editor', create_function('', 'return "tinymce";') ); | |
# This sets the HTML Editor as default # | |
add_filter( 'wp_default_editor', create_function('', 'return "html";') ); | |
?> |
This file contains hidden or 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 | |
/** | |
* Detect Browser | |
* Add a class to BODY tag | |
*/ | |
add_filter('body_class','browser_body_class'); | |
function browser_body_class($classes) { | |
global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone; | |
if($is_lynx) $classes[] = 'lynx'; | |
elseif($is_gecko) $classes[] = 'gecko'; |
This file contains hidden or 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: Plugin Name | |
Plugin URI: http://example.com/the-plugin | |
Description: A brief description of the Plugin. | |
Version: 1.0 | |
Author: Your name | |
Author URI: http://example.com | |
License: GPL2? | |
*/ |
This file contains hidden or 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 | |
/** | |
* Check if user is logged in | |
*/ | |
if ( is_user_logged_in() ) { | |
echo 'Welcome, registered user!'; | |
} else { | |
echo 'Welcome, visitor!'; | |
}; | |
?> |