Skip to content

Instantly share code, notes, and snippets.

View netwizards's full-sized avatar

Krzysztof netwizards

View GitHub Profile
@netwizards
netwizards / gist:5335919
Last active December 15, 2015 22:49 — forked from hitautodestruct/readme.md
wp, custom wp nav menu wp_get_nav_menu_items
<?php
$menu_name = 'main_nav';
$locations = get_nav_menu_locations();
$menu = wp_get_nav_menu_object( $locations[ $menu_name ] );
$menuitems = wp_get_nav_menu_items( $menu->term_id, array( 'order' => 'DESC' ) );
?>
<nav>
<ul class="main-nav">
<?php
@netwizards
netwizards / iphone_disable_autozoom_input.css
Created September 14, 2016 12:22 — forked from vedranjaic/iphone_disable_autozoom_input.css
css: iPhone - Disable auto-zoom on input fields
/*
* disable auto-zoom on iphone input field focus
* http://www.456bereastreet.com/archive/201212/ios_webkit_browsers_and_auto-zooming_form_controls/
*/
input[type='text']:focus,
input[type='number']:focus,
textarea:focus {
font-size: 16px;
}
@netwizards
netwizards / wp-query-ref.php
Created November 12, 2016 08:28 — forked from luetkemj/wp-query-ref.php
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(
@netwizards
netwizards / CreateGrid_0_0.js
Created November 22, 2016 21:10 — forked from frederickk/CreateGrid_0_0.js
a script which allows one to create a grid (margins, rows, and columns) in illustrator similar to "create guides..." in indesign.
/**
* Create Grid
*
* Ken Frederick
* ken.frederick@gmx.de
*
* http://cargocollective.com/kenfrederick/
* http://kenfrederick.blogspot.com/
*
*/
$context = Timber::get_context();
$context['slides'] = Timber::get_posts('post_type=slides');
$context['pages'] = Timber::get_posts('post_type=page&posts_per_page=2');
$context['portfolio'] = Timber::get_posts('post_type=portfolio');
$context['posts'] = Timber::get_posts(); //leave blank for default page query
Timber::render('front-page.twig', $context);
@netwizards
netwizards / functions.php
Created September 14, 2017 13:41 — forked from WooForce/functions.php
Change the default "no available shipping methods" message on cart/checkout page
add_filter( 'woocommerce_cart_no_shipping_available_html', 'change_msg_no_available_shipping_methods', 10, 1 );
add_filter( 'woocommerce_no_shipping_available_html', 'change_msg_no_available_shipping_methods', 10, 1 );
function change_msg_no_available_shipping_methods( $default_msg ) {
$custom_msg = "Call us for quotation - 1-800-XXX-XXXX";
if( empty( $custom_msg ) ) {
return $default_msg;
}
return $custom_msg;
}
@netwizards
netwizards / responsive-video.css
Created July 10, 2018 08:39 — forked from jaicab/responsive-video.css
Pure CSS solution for embed videos with an aspect ratio of 16:9
.video-container {
position: relative;
padding-bottom: 56.25%; /*16:9*/
padding-top: 30px;
height: 0;
overflow: hidden;
}
.video-container iframe,
.video-container object,
@netwizards
netwizards / functions.php
Created January 3, 2019 13:54
Remove WooCommerce Add to Cart/Read More button
//* Remove WooCommerce Add to Cart/Read More button
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
@netwizards
netwizards / wc-bookings-availability-search.php
Created January 3, 2019 14:00 — forked from apintocr/wc-bookings-availability-search.php
WooCommerce Bookings Availability Search
<?php
/**
* WooCommerce Bookings Availability Search
*
* This is almost pseudo code, it only serves to explain the "how to do it" and does not attempt to be "The Way" to do it.
* NOTE: This NEEDS to be refined in order to work as expected.
*
* @author António Pinto <apinto@vanguardly.com>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
// Get The Page ID You Need
get_option( 'woocommerce_shop_page_id' );
get_option( 'woocommerce_cart_page_id' );
get_option( 'woocommerce_checkout_page_id' );
get_option( 'woocommerce_pay_page_id' );
get_option( 'woocommerce_thanks_page_id' );
get_option( 'woocommerce_myaccount_page_id' );
get_option( 'woocommerce_edit_address_page_id' );
get_option( 'woocommerce_view_order_page_id' );
get_option( 'woocommerce_terms_page_id' );