This file contains hidden or 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
Here is a simple receipt to enable the hamburger menu on all screen sizes of a FoundationPress-based Wordpress theme. | |
Step 1: Add a huge breakpoint to _settings.scss | |
$breakpoints: ( | |
small: 0, | |
medium: 640px, | |
large: 1024px, | |
xlarge: 1200px, | |
xxlarge: 1440px, |
This file contains hidden or 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
// Smooth anchor nav scrolling | |
// Handle links with @href started with '#' only | |
$(document).on('click', 'a[href^="#"]', function(e) { | |
// target element id | |
var id = $(this).attr('href'); | |
// target element | |
var $id = $(id); | |
if ($id.length === 0) { |
This file contains hidden or 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( 'gform_phone_formats', 'au_phone_format' ); | |
function au_phone_format( $phone_formats ) { | |
$phone_formats['au'] = array( | |
'label' => 'Australia', | |
'mask' => false, | |
'regex' => '/^\({0,1}((0|\+61)(2|4|3|7|8)){0,1}\){0,1}(\ |-){0,1}[0-9]{2}(\ |-){0,1}[0-9]{2}(\ |-){0,1}[0-9]{1}(\ |-){0,1}[0-9]{3}$/', | |
'instruction' => false, | |
); | |
return $phone_formats; |
This file contains hidden or 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
if ( ! function_exists( 'foundationpress_top_bar_r' ) ) { | |
function foundationpress_top_bar_r() { | |
wp_nav_menu( array( | |
'container' => false, | |
'menu_class' => 'dropdown menu', | |
'items_wrap' => '<ul id="%1$s" class="%2$s desktop-menu" data-dropdown-menu data-alignment="left">%3$s</ul>', | |
'theme_location' => 'top-bar-r', | |
'depth' => 3, | |
'fallback_cb' => false, | |
'walker' => new Foundationpress_Top_Bar_Walker(), |
This file contains hidden or 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
/* | |
This JS creates collapsible Gravity Form sections breaks | |
IMPORTANT: | |
1 - Within the Gravity form, you must add the class collapsible to each section break. | |
2 - All fields within those section breaks must have the class collapsible_field | |
3 - You must include both the CSS and the JS |
This file contains hidden or 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
@mixin flex-container { | |
display: flex; | |
align-items: center; | |
justify-content: center; | |
} | |
@mixin flex-item-top { | |
align-items: flex-start; | |
align-self: flex-start; | |
} |
This file contains hidden or 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
.grid-x > .xlarge-8 { | |
@include breakpoint(xlarge) { | |
width: 66.66667%; | |
} | |
} | |
.xlarge-offset-1 { | |
@include breakpoint(xlarge) { | |
margin-left: 8.33333%; | |
} |
This file contains hidden or 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
// | |
// | |
// Custom breakpoint for larger tablets | |
// | |
// | |
$breakpoints: ( | |
small: 0, | |
medium: 640px, | |
tablet: 860px, |
This file contains hidden or 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( 'gform_phone_formats', 'au_phone_format' ); | |
function au_phone_format( $phone_formats ) { | |
$phone_formats['au'] = array( | |
'label' => 'Australia', | |
'mask' => '99 9999 9999', | |
'regex' => '/^\({0,1}((0|\+61)(2|4|3|7|8)){0,1}\){0,1}(\ |-){0,1}[0-9]{2}(\ |-){0,1}[0-9]{2}(\ |-){0,1}[0-9]{1}(\ |-){0,1}[0-9]{3}$/', | |
'instruction' => 'Australian phone numbers.', | |
); | |
return $phone_formats; |
This file contains hidden or 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
// | |
// WooCommerce - replace read more buttons for out of stock items | |
// | |
if (!function_exists('woocommerce_template_loop_add_to_cart')) { | |
function woocommerce_template_loop_add_to_cart() { | |
global $product; | |
if ( !$product->is_in_stock() ) { | |
echo '<a href="'.get_permalink().'" rel="nofollow" class="outofstock button">Out of Stock</a>'; | |
} else { | |
woocommerce_get_template('loop/add-to-cart.php'); |