View Woocommerce replace product listing button to link to product
View Rename woocommerce tabs
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;
}
View Remove heading from description tab woocommerce
// remove redundant "description" heading from description tab
add_filter( 'woocommerce_product_description_heading', 'remove_product_description_heading' );
function remove_product_description_heading() {
return '';
}
View add to head
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
}
View cat-order
/* ----------------------------------- stop categories going out of order in WP page/poasts admin ---------------*/
function taxonomy_checklist_checked_ontop_filter ($args)
{
$args['checked_ontop'] = false;
return $args;
}
View 404 to 301
/* 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;
View gist:8b17ca7ffc8f2e725f18
/* = 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;
View cat-class-to-body
// 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();
View wp-white-screen-of-death
// 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);
View hide_admin_functions
// ------------------------------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)]);}