Skip to content

Instantly share code, notes, and snippets.

@tomharrigan
tomharrigan / wc-prod-to-reports
Created December 24, 2012 02:45
change products to reports in breadcrumb
// Replace "Products" with "Reports" in breadcrumb.
add_filter( 'woo_breadcrumbs_trail', 'woo_custom_filter_breadcrumbs_trail_replaceproducts', 40 );
function woo_custom_filter_breadcrumbs_trail_replaceproducts ( $trail ) {
foreach ( $trail as $k => $v ) {
if ( is_singular() && ( get_post_type() == 'product' ) && strtolower( strip_tags( $v ) ) == 'products' ) {
unset( $trail[$k] );
}
@tomharrigan
tomharrigan / coquette-cart
Created December 24, 2012 02:46
Modify cart text in coquette
<div id="btn-cart" class="fr">
<a href="<?php echo $woocommerce->cart->get_cart_url(); ?>" title="<?php _e('View your shopping cart', 'woothemes'); ?>">
<span class="btn-cart-inner">
<?php
echo sprintf(_n('Shopping Tote &ndash; %d item', 'Shopping Tote &ndash; %d items ', $woocommerce->cart->get_cart_contents_count(), 'woothemes'), $woocommerce->cart->get_cart_contents_count());
?>
</span>
</a>
</div>
@tomharrigan
tomharrigan / responsivemystile
Created December 24, 2012 21:43
mods to css
/*
WOO CUSTOM STYLESHEET
---------------------
Instructions:
Add your custom styles in this file instead of style.css so it
is easier to update the theme. Simply copy an existing style
from style.css to this file, and modify it to your liking. */
#social-links a {
display: inline-block;
height: 28px;
width: 30px;
background-image: url(http://laurenfollett.com/wp-content/themes/canvas/images/ico-subscribe-social.png);
background-repeat: no-repeat;
}
@tomharrigan
tomharrigan / canvas-fb-nav
Created January 3, 2013 09:55
fb icon in nav menu
add_filter( 'wp_nav_menu_items', 'woo_custom_add_sociallink_navitems', 10, 2 );
function woo_custom_add_sociallink_navitems ( $items, $args ) {
global $woo_options;
if ( $args->theme_location == 'primary-menu' ) {
$template_directory = get_template_directory_uri();
$profiles = array(
@tomharrigan
tomharrigan / centerednav
Last active December 10, 2015 13:38
centered nav menu fix
#navigation {
position: relative;
}
#main-nav {
clear: left;
float: left;
list-style: none;
margin: 0;
padding: 0;
position: relative;
@tomharrigan
tomharrigan / gist:4450420
Created January 4, 2013 06:34
post meta date only
function woo_post_meta() {
if ( is_page() ) { return; }
$post_info = '<span class="small">' . _x( '', 'post datetime', 'woothemes' ) . '</span> [post_date] <span class="small">' . ' [post_edit]';
printf( '<div class="post-meta">%s</div>' . "\n", apply_filters( 'woo_filter_post_meta', $post_info ) );
} // End woo_post_meta()
@tomharrigan
tomharrigan / gist:4450740
Created January 4, 2013 07:50
add rich snippet stuff for date
function woo_post_meta() {
if ( is_page() ) { return; }
$post_info = '<span class="small">' . __( 'By', 'woothemes' ) . '</span> [post_author_posts_link] <span class="small">' . _x( 'on', 'post datetime', 'woothemes' ) . '</span><span class="updated"> [post_date] </span><span class="small">' . __( 'in', 'woothemes' ) . '</span> [post_categories before=""] ' . ' [post_edit]';
printf( '<div class="post-meta">%s</div>' . "\n", apply_filters( 'woo_filter_post_meta', $post_info ) );
} // End woo_post_meta()
@tomharrigan
tomharrigan / gist:4465217
Created January 6, 2013 04:33
Add WooSlider to woo_header_inside
add_action( 'woo_header_inside', 'woo_add_wooslider' );
function woo_add_wooslider () {
// WooSlider code here
wooslider();
} // End woo_add_wooslider()
@tomharrigan
tomharrigan / gist:4466056
Created January 6, 2013 08:24
Fix PixelPress breadcrumb issue
function woo_display_breadcrumbs() {
global $woo_options;
if ( !is_home() && !is_front_page() && !is_singular( 'post' ) && !is_post_type_archive( 'post' ) && !is_page_template('template-blog.php') && !is_singular( 'portfolio' ) & !is_post_type_archive( 'portfolio' ) & !is_page_template('template-portfolio.php') ) {
if ( isset( $woo_options['woo_breadcrumbs_show'] ) && $woo_options['woo_breadcrumbs_show'] == 'true' ) {
echo '<section id="breadcrumbs">';
woo_breadcrumbs();
echo '</section><!--/#breadcrumbs -->';
}
}
} // End woo_display_breadcrumbs()