Skip to content

Instantly share code, notes, and snippets.

View GarySwift's full-sized avatar

Gary Swift GarySwift

  • Waterford City, Ireland
View GitHub Profile
@GarySwift
GarySwift / _buttons.php
Last active May 21, 2018 09:13
Skew button group experiment for Zurb Foundation
<div class="button-group skew">
<div class="button-wrap one"><a href="#" class="button button-one">Book Now</a></div><!--
--><div class="button-wrap two"><a href="#" class="button button-two">More Info</a></div>
</div>
@GarySwift
GarySwift / README.md
Last active May 10, 2018 08:00
Get WordPress content - various ways
@GarySwift
GarySwift / _fucntions.php
Created May 9, 2018 12:28
Unfinished notes for saving ACF field groups into post content. #WordPress #ACF
<?php
if ( ! function_exists('write_log')) {
function write_log ( $log ) {
if ( is_array( $log ) || is_object( $log ) ) {
error_log( print_r( $log, true ) );
} else {
error_log( $log );
}
}
}
@GarySwift
GarySwift / fix_request_redirect.php
Created April 26, 2018 08:12
Using pagination on a CPT single page
<?php
/**
* Adding pagination for CPT section
*
* This is fix for using pagination on a CPT single page
*
* @link https://wordpress.stackexchange.com/questions/233885/yet-another-custom-post-type-with-pagination-not-working-in-wordpress
*
* @param $request
*/
@GarySwift
GarySwift / README.md
Last active April 23, 2018 10:55
FoundationPress Container Padding Fix (Notes)

src/assets/scss/modules/_content.scss

.main-container {
  @include xy-grid-container( $grid-container, 0 );//Set $grid-container-padding to 0
}

.main-grid {

 // Default template
@GarySwift
GarySwift / _woocommerce.php
Last active May 8, 2019 08:24
Various WooCommerce helper functions.
<?php
/**
* WooCommerce compatibility
*
* Add this if you want to use the 'woocommerce.php' file.
*
* @link: https://github.com/olefredrik/FoundationPress/issues/982
*/
add_action( 'after_setup_theme', function() {
add_theme_support( 'woocommerce' );
@GarySwift
GarySwift / README.md
Last active April 4, 2018 10:34
Installation notes Garand Sticky (FoundationPress)
@GarySwift
GarySwift / _truncate.php
Created March 21, 2018 13:31
PHP function to truncate string
<?php
# Truncate string
function truncate($string,$length=170,$append="&hellip;") {
$string = trim($string);
if(strlen($string) > $length) {
$string = wordwrap($string, $length);
$string = explode("\n", $string, 2);
$string = $string[0] . $append;
}
@GarySwift
GarySwift / _README.md
Last active March 27, 2018 08:31
Notes for Isotope masonry gallery in FoundationPress

Isotope

https://isotope.metafizzy.co/

Filter & sort layouts

Package managers

npm: npm install isotope-layout --save

Bower: bower install isotope-layout --save

Sticky Header with Slide-Down/Slide-Up

Sticky header with slide down and up effect for use with FoundastionPress.

FoundationPress is a WordPress starter theme based on Foundation 6 by Zurb https://foundationpress.olefredrik.com