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
define( 'WP_CONTENT_DIR', dirname( __FILE__ ) . 'path/to/wp-content' ); | |
define( 'WP_CONTENT_URL', 'http://' . $_SERVER['HTTP_HOST'] . '/path/to/wp-content' ); |
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
define('ABSPATH', dirname(__FILE__) . '/'); | |
require_once(ABSPATH . '../path/to/wp-config.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
add_action('after_setup_theme', 'remove_admin_bar'); | |
function remove_admin_bar() | |
{ | |
if (!current_user_can('administrator') && !is_admin()) | |
{ | |
show_admin_bar(false); | |
} | |
} |
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://www.designyourway.net/blog/resources/31-css-code-snippets-to-make-you-a-better-coder/ |
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
<ul class="box"> | |
<li></li> | |
<li></li> | |
<li></li> | |
<li></li> | |
<li></li> | |
<li></li> | |
</ul> | |
ul.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
update table_name set field_name = replace(field, 'search_string', 'replace_string') where instr(field_name, 'search_string') > 0; |
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 the_slug() { | |
$post_data = get_post($post->ID, ARRAY_A); | |
$slug = $post_data['post_name']; | |
return $slug; | |
} |
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 get_attachment_icons($echo = false){ | |
$sAttachmentString = "<div class='documentIconsWrapper'> \n"; | |
if ( $files = get_children(array( //do only if there are attachments of these qualifications | |
'post_parent' => get_the_ID(), | |
'post_type' => 'attachment', | |
'numberposts' => -1, | |
'post_mime_type' => 'application/pdf', //MIME Type condition | |
))){ | |
foreach( $files as $file ){ //setup array for more than one file attachment | |
$file_link = wp_get_attachment_url($file->ID); //get the url for linkage |
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
.wrapper { | |
border: 1px solid black; | |
width: 400px; | |
display:table; | |
} | |
.left { | |
border: 1px solid green; | |
display: table-cell; | |
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
add_action( 'init', 'child_manage_woocommerce_styles', 99 ); | |
define( 'WOOCOMMERCE_USE_CSS', false ); | |
/** | |
* Remove all WooCommerce scripts and styles | |
* | |
* @author WP Smith | |
* @since 1.0.0 | |
*/ |