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_action( 'add_meta_boxes', 'add_metaname_box'); | |
add_action( 'save_post', 'metaname_save'); | |
function add_metaname_box() { |
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
remove_action( 'wp_head', 'rsd_link' ); // Display the link to the Really Simple Discovery service endpoint, EditURI link | |
remove_action( 'wp_head', 'index_rel_link' ); // index link | |
(from http://wpengineer.com/1438/wordpress-header/ ) |
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
Show hidden characters
{ | |
"cmd" : ["gcc ${file} -o ${file_base_name}.out && ./${file_base_name}.out"], | |
"path" : "/usr/bin:/usr/local/bin", | |
"shell" : true | |
} |
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
This is usually caused by using multiple different ssh keys for a server without turning on IdentitiesOnly. | |
To get access to your account, get your host to run ssh-add -D to clear the identities. Once you are logged back in, add this to your ~/.ssh/config file: | |
IdentitiesOnly yes | |
via: http://superuser.com/questions/187779/too-many-authentication-failures-for-username |
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 | |
// Add to functions.php | |
// Add page-slug to body | |
function add_body_class( $classes ) | |
{ | |
global $post; | |
if ( isset( $post ) ) { | |
if (substr($post->post_type, 0, 4) == 'page') { | |
$classes[] = $post->post_type . '-' . $post->post_name; |
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 | |
// Add to functions.php | |
// Make sure your custom post type has 'page-attributes' in its supports array | |
// Adjust the 'typeN's to your custom post types | |
// the first type | |
add_filter( 'wp_insert_post_data', 'set_menu_order', 10, 2 ); | |
function set_menu_order( $data, $postarr ) { | |
global $post; | |
$pt = $data['post_type']; | |
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 createSrcCall(tabId, src, callback) { | |
return function () { | |
if (callback !== undefined) { | |
chrome.tabs.executeScript(tabId, {file: src}, callback); | |
} else { | |
chrome.tabs.executeScript(tabId, {file: src}); | |
} | |
}; | |
} |
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
default_run_options[:pty] = true # Must be set for the password prompt from git to work | |
# Tell Capistrano to use agent forwarding with this command. uses your local keys instead of keys installed on the server. | |
ssh_options[:forward_agent] = true | |
ssh_options[:keys] = %w('~/.ssh/id_rsa.pub') | |
# shared hosts e.g. hostgator prevent filfefs with high (>5) group privileges from being run (rightfully) | |
set :group_writable, false | |
# You will probably have to update any submodules that are have an SSH remote to use https e.g. |
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
.embed-wrap { | |
position: relative; | |
padding-top: 25px; /* IE6 workaround*/ | |
height: 0; | |
object, embed, iframe { | |
position: absolute; | |
top: 0; | |
left: 0; | |
width: 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
function remove_img_dimensions($html) { | |
$dom = new DOMDocument; | |
$dom->loadHTML($html); | |
$imgs = $dom->getElementsByTagName('img'); | |
foreach ($imgs as $img) { | |
$img->removeAttribute('width'); | |
$img->removeAttribute('height'); | |
} |
OlderNewer