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 | |
/* Remove width/height from featured images */ | |
add_filter( 'post_thumbnail_html', 'remove_thumbnail_dimensions', 10 ); | |
add_filter( 'image_send_to_editor', 'remove_thumbnail_dimensions', 10 ); | |
function remove_thumbnail_dimensions( $html ) { | |
$html = preg_replace( '/(width|height)=\"\d*\"\s/', "", $html ); | |
return $html; | |
} |
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 | |
function hide_editor_leave_media_button() { | |
global $current_screen; | |
if( $current_screen->post_type == 'ENTER_POST_TYPE_HERE' ) { | |
$css = '<style type="text/css">'; | |
$css .= '#wp-content-editor-container, #post-status-info, .wp-switch-editor { display: none; }'; | |
$css .= '</style>'; | |
echo $css; |
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
jQuery(function(){ | |
jQuery('input, textarea').each(function(){ | |
var txtval = jQuery(this).val(); | |
jQuery(this).focus(function(){ | |
jQuery(this).val('') | |
}); | |
jQuery(this).blur(function(){ | |
if(jQuery(this).val() == ""){ | |
jQuery(this).val(txtval); | |
} |
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 | |
remove_action('woocommerce_pagination', 'woocommerce_catalog_ordering', 20 ); |
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 | |
remove_action( 'woocommerce_before_main_content', | |
'woocommerce_breadcrumb', 20, 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
//Put this in your root index.php file | |
<?php | |
error_reporting(E_ALL); | |
ini_set('display_errors','On'); |
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 // change these values in wp-config.php | |
define('WP_DEBUG', true); | |
define('WP_DEBUG', 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
<?php | |
//Add this to template.php | |
function YOURTHEME_theme(&$existing, $type, $theme, $path){ | |
$hooks = array(); | |
// Make user-register.tpl.php available | |
$hooks['user_register_form'] = array ( | |
'render element' => 'form', |
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
/* functions.php */ | |
<?php | |
class description_walker extends Walker_Nav_Menu | |
{ | |
function start_el(&$output, $item, $depth, $args) | |
{ | |
global $wp_query; | |
$indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; | |
$class_names = $value = ''; |
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 | |
$block = block_load('module_name', 'block_name'); | |
$output = drupal_render(_block_get_renderable_array(_block_render_blocks(array($block)))); | |
print $output; | |
//module_name is the name of module that outputs the block, eg. webform | |
//block_name is the name of the block, you can find it out by hovering on configure link on block admin page, eg. client-block-19 |