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
SELECT node.nid, node.type, node_revision.title, url_alias.alias AS url, if(node.changed = 0,FROM_UNIXTIME(node.created),FROM_UNIXTIME(node.changed)) AS last_modified | |
FROM node INNER JOIN node_revision ON (node.vid = node_revision.vid) INNER JOIN url_alias ON (url_alias.source = CONCAT('node/', node_revision.nid)) | |
WHERE node.status = 1 | |
ORDER BY url; |
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
truncate table `cache`; | |
truncate table `cache_admin_menu`; | |
truncate table `cache_block`; | |
truncate table `cache_bootstrap`; | |
truncate table `cache_field`; | |
truncate table `cache_filter`; | |
truncate table `cache_form`; | |
truncate table `cache_image`; | |
truncate table `cache_libraries`; | |
truncate table `cache_menu`; |
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
Select all and delete (actually move to buffer) | |
:%d | |
Select all and copy to buffer | |
:%y | |
Use p to paste the buffer. |
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_filter('the_content', 'wpr_google_plusone'); | |
function wpr_google_plusone($content) { | |
$content = $content.'<div class="plusone"><g:plusone size="tall" href="'.get_permalink().'"></g:plusone></div>'; | |
return $content; | |
} | |
add_action ('wp_enqueue_scripts','wpr_google_plusone_script'); | |
function wpr_google_plusone_script() { | |
wp_enqueue_script('google-plusone', 'https://apis.google.com/js/plusone.js', array(), null); | |
} |
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
[mailto][email protected][/mailto] | |
function mail_shortcode( $atts , $content=null ) { | |
for ($i = 0; $i < strlen($content); $i++) $encodedmail .= "&#" . ord($content[$i]) . ';'; | |
return '<a href="mailto:'.$encodedmail.'">'.$encodedmail.'</a>'; | |
} | |
add_shortcode('mailto', 'mail_shortcode'); |
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
http://website.com/login | |
RewriteRule ^login$ http://yoursite.com/wp-login.php [NC,L] |
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 replace_excerpt($content) { | |
return str_replace('[...]', | |
'... <div class="more-link"><a href="'. get_permalink() .'">Continue Reading</a></div>', | |
$content | |
); | |
} | |
add_filter('the_excerpt', 'replace_excerpt'); | |
- Via http://css-tricks.com/snippets/wordpress/replace-excerpt-ellipsis-with-permalink/ |
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 add_contact_methods( $contactmethods ) { | |
// Add Google Profiles | |
$contactmethods['google_profile'] = 'Google Profile URL'; | |
return $contactmethods; | |
} | |
add_filter( 'user_contactmethods', 'add_contact_methods', 10, 1); | |
Author.php |
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 yoast_allow_rel() { | |
global $allowedtags; | |
$allowedtags['a']['rel'] = array (); | |
} | |
add_action( 'wp_loaded', 'yoast_allow_rel' ); | |
Via: http://yoast.com/wordpress-rel-author-rel-me/ |
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
$upload_dir = wp_upload_dir(); | |
echo $upload_dir['baseurl']; |
NewerOlder