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( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 ); | |
function woo_rename_tabs( $tabs ) { | |
$tabs['description']['title'] = __( 'More Information' ); // Rename the description tab | |
$tabs['reviews']['title'] = __( 'Ratings' ); // Rename the reviews tab | |
$tabs['additional_information']['title'] = __( 'Product Data' ); // Rename the additional information tab | |
return $tabs; | |
} |
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 redundant "description" heading from description tab | |
add_filter( 'woocommerce_product_description_heading', 'remove_product_description_heading' ); | |
function remove_product_description_heading() { | |
return ''; | |
} |
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('wp_head', 'wpse_43672_wp_head'); | |
function wpse_43672_wp_head(){ | |
//Close PHP tags | |
?> | |
ADD YOUR PLAIN HTML CODE HERE | |
<?php //Open PHP tags | |
} |
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
/* ----------------------------------- stop categories going out of order in WP page/poasts admin ---------------*/ | |
function taxonomy_checklist_checked_ontop_filter ($args) | |
{ | |
$args['checked_ontop'] = false; | |
return $args; | |
} |
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
/* Redirect 404 to correct page */ | |
add_filter( '404_template', 't5_redirect_to_category' ); | |
function t5_redirect_to_category( $template ) | |
{ | |
if ( ! is_404() ) | |
return $template; | |
global $wp_rewrite, $wp_query; |
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 a "molly guard" to the publish button */ | |
add_action( 'admin_print_footer_scripts', 'sr_publish_molly_guard' ); | |
function sr_publish_molly_guard() { | |
echo <<<EOT | |
<script> | |
jQuery(document).ready(function($){ | |
$('#publishing-action input[name="publish"]').click(function() { | |
if(confirm('Are you sure you want to publish this?')) { | |
return 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
// add category class to body | |
function body_class_add_categories( $classes ) { | |
// Only proceed if we're on a single post page | |
if ( !is_single() ) | |
return $classes; | |
// Get the categories that are assigned to this post | |
$post_categories = get_the_category(); | |
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 to wp-config.php to view errors if your WP install only shows a white page | |
error_reporting(E_ALL); ini_set('display_errors', 1); | |
define( 'WP_DEBUG', 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
// ------------------------------hide admin menus in sidebar | |
function remove_menu_items() { | |
global $menu; | |
$restricted = array(__('Dashboard'), __('Pages') , __('Posts'), __('Comments'), __('Media'), __('Plugins'), __('Appearance'), __('Settings'), __('Tools'), __('Users')); | |
end ($menu); | |
while (prev($menu)){ | |
$value = explode(' ',$menu[key($menu)][0]); | |
if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){ | |
unset($menu[key($menu)]);} |
NewerOlder