Skip to content

Instantly share code, notes, and snippets.

@omurphy27
omurphy27 / barebones-forms-fields-css.css
Last active September 14, 2015 16:47
Barebones Form Fields, Input, Textarea HTML CSS Styling
input[type=text],
input[type=email],
input[type=tel],
textarea,
select {
width: 100%;
display: block;
border: 1px solid #1ada35;
background: #fff;
font: 300 22px/50px 'Oswald', sans-serif;
@omurphy27
omurphy27 / Open-link-in-new-window-and-print-js-javascript.js
Created August 5, 2015 20:30
JS / HTML open Link to Image in New Window and Print Image
@omurphy27
omurphy27 / woocommerce_hooks_conditional.php
Created July 20, 2015 17:38
Executing WooCommerce Action Hooks within a Conditional
// the priority (3rd parameter) must be lower than the action that is being removed
add_action('woocommerce_single_product_summary','jwd_remove_title',4);
function jwd_remove_title() {
// the conditional must be inside a function
if (is_single()) {
remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_title',5);
}
}
@omurphy27
omurphy27 / woocommerce-header-cart.php
Last active October 8, 2015 21:35
WooCommerce Header Cart Items Link
<?php global $woocommerce; ?>
<a href="<?php echo $woocommerce->cart->get_cart_url(); ?>" title="<?php _e('View your shopping cart', 'woothemes'); ?>" class="cart-link">
Cart (<span><?php echo sprintf(_n('%d', '%d', $woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count);?></span>)
</a>
@omurphy27
omurphy27 / Quick active class toggle for bootstrap hamburger menu using Jquery.js
Created July 8, 2015 19:43
Quick active class toggle for bootstrap hamburger menu using Jquery.js
$('.navbar-toggle').click(function() {
$(this).toggleClass('active');
});
@omurphy27
omurphy27 / wp_query_woocommerce_product_category.php
Last active November 9, 2023 23:05
Wordpress WP_Query in WooCommerce for a Product Category aka Taxonomy which is ordered by a Custom Field
<?php
$args = array(
'posts_per_page' => 7,
'post_type' => 'product',
'product_cat' => 'home-featured',
'meta_key' => 'home_featured_order',
'orderby' => 'meta_value_num',
'order' => 'DESC'
);
@omurphy27
omurphy27 / jquery-ajax-form-submit.js
Last active March 26, 2016 08:15
Jquery Ajax Form Submit Example
$formUserchange.on('submit', function(e) {
e.preventDefault();
var $newUser = $(this).find('input[name=new-username]').val(),
$url = $(this).attr('action'),
$method = $(this).attr('method'),
$data = {
'new-username' : $newUser
};
@omurphy27
omurphy27 / remove-tabs-from-woocommerce-single-product-view
Last active August 29, 2015 14:22
Remove tabs from WooCommerce Single Product View
function woo_remove_product_tabs( $tabs ) {
unset( $tabs['description'] ); // Remove the description tab
unset( $tabs['additional_information'] ); // Remove the additional information tab
unset( $tabs ); // Remove all tabs
return $tabs;
}
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 97 );
@omurphy27
omurphy27 / WooCommerce - Get Taxonomy Terms for a Product
Created June 3, 2015 20:02
WooCommerce - Get Taxonomy Terms for a Product
<?php
// global $product; // only define if necessary, on most templates it won't be
$terms = get_the_terms( $product->id, 'product_cat' );