Skip to content

Instantly share code, notes, and snippets.

View michaelbrazell's full-sized avatar

Mike Murray michaelbrazell

View GitHub Profile
@michaelbrazell
michaelbrazell / WP_child-page-loop.php
Created June 22, 2017 23:23
Loop through the contents of a child page, displaying it as a modal with foundation
if ( ! function_exists ( 'xad_product_childpage ' )) :
function xad_product_childpage($pageId) {
$childArgs = array(
'sort_order' => 'ASC',
'sort_column' => 'menu_order',
'child_of' => $pageId
);
$childList = get_pages($childArgs);
@michaelbrazell
michaelbrazell / foundation-remove-class-modal-close.js
Created July 15, 2017 00:03
Foundation 6.3.1 has an issue when modifying Reveal where it doesn't remove the is-reveal-open class from the body after closing a reveal. You can hook into the close event to fire this. This was fixed in 6.4 but if you can't update and don't want to modify the core Foundation files, you can add this to your page. Requires jQuery obviously.
// Fix issue with foundation not closing "is reveal open"
$(document).on('closed.zf.reveal', function() {
if ($('body').hasClass('is-reveal-open')) {
$('body').removeClass('is-reveal-open');
}
});
@michaelbrazell
michaelbrazell / CSS Property Order - Box Model
Last active January 26, 2018 21:25
Ordering CSS properties by the box model
width: ;
height: ;
min-width: ;
max-width: ;
min-height: ;
max-height: ;
padding: ;
padding-top: ;
padding-right: ;