⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
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 | |
// Create *_ taxonomy | |
add_action( 'init', 'create_TAXONOMYNAME' ); | |
function create_TAXONOMYNAME() { | |
$labels = array( | |
'name' => _x( 'PLURAL', 'taxonomy general name' ), | |
'singular_name' => _x( 'SINGULAR', 'taxonomy singular name' ), | |
'search_items' => __( 'Search PLURAL' ), | |
'all_items' => __( 'All PLURAL' ), | |
'parent_item' => __( 'Parent SINGULAR' ), |
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
// the number is the author ID | |
<?php $author = get_userdata(2); echo $author->user_description; ?> |
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
/* The next time you hear "needs more wow," add this to the stylesheet. | |
- Dan Cederholm at Build Conference 2010 https://vimeo.com/17091905 */ | |
*:hover { | |
-webkit-transform: rotate(180deg); | |
-moz-transform: rotate(180deg); | |
-o-transform: rotate(180deg); | |
transform: rotate(180deg); | |
} |
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
<snippet> | |
<content><![CDATA[ | |
// Create taxonomy | |
add_action( 'init', 'create_${1:FUNCTION}' ); | |
function create_${1:FUNCTION}() { | |
\$labels = array( | |
'name' => _x( '${3:PLURAL}', 'taxonomy general name' ), | |
'singular_name' => _x( '${2:SINGULAR}', 'taxonomy singular name' ), | |
'search_items' => __( 'Search ${3:PLURAL}' ), |
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
// Hide "Preview" button | |
function hide_preview_button() | |
{ | |
global $current_screen; | |
if ( 'CUSTOM_POST_TYPE' == $current_screen->post_type ) { | |
echo '<style>#preview-action,.updated a{display:none;}</style>'; | |
} | |
} | |
add_action('admin_head', 'hide_preview_button'); |
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
/* In making a child theme of Twenty Twelve, I didn't want to use the standard @import in the production CSS. | |
* Since I'm using Sass, I "Sass-ified" Twenty Twelve so that it could be imported directly into my own stylesheet. | |
* This way it can be minifed, and I can save an http request. Double win. | |
* I removed a lot of comments, because the .sass syntax is really particular about formatting. | |
* I preserved the line numbering just in case the files needed comparing (thus all the blank lines). | |
* | |
* (FYI, I'm enqueueing a different stylesheet in the theme files than the one that identifies the theme.) | |
*/ | |
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
// Sass v3.2.5 | |
// Compass v0.13.alpha.0 | |
a | |
+transition(all, 0.3s) | |
div | |
@include box-sizing(border-box) | |
@include border-radius(4px) |
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_twentytwelve_styles() { | |
wp_dequeue_style( 'twentytwelve-style' ); | |
wp_deregister_style( 'twentytwelve-style' ); | |
wp_enqueue_style( 'my-style', get_stylesheet_directory_uri() . '/css/style.css' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'replace_twentytwelve_styles', 11 ); |
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
wp() { | |
# Needs two parameters | |
# Parameter 1 is the account name, or install directory | |
# Parameter 2 will set the database password | |
cd ~/../home/${1}/public_html # go to install directory | |
wget http://wordpress.org/latest.tar.gz # get latest WordPress | |
tar xfz latest.tar.gz # unpack | |
chown -R ${1} wordpress # change all files in wordpress to be owned by user (solves a problem when installing as root) | |
chgrp -R ${1} wordpress # change associated group (solves a problem when installing as root) | |
mv wordpress/* ./ # move all files from /wordpress to the root directory |
OlderNewer