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 / _page-post-screen-columns.php
Created June 14, 2017 08:05
WordPress: Page Post Screen Columns
<?php
/*
* WordPress: Page Post Screen Columns
*
* To add a custom column for pages, hook the manage_pages_columns filter.
*/
define("SHOW_ICON", true);
if (SHOW_ICON) {
/*
@GarySwift
GarySwift / README.md
Last active October 22, 2023 14:33
WordPress Testimonials Custom Post Type #cpt #acf

WordPress Testimonials Custom Post Type

Add a custum post type for testimonails in WordPress.

This includes Advanced Custom Fields field groups for some extra fields.

Usage

Create a directory to store all files.

@GarySwift
GarySwift / _svg.scss
Last active April 5, 2018 08:43
SVG in PHP example #WordPress. It uses the PHP function 'file_get_contents' to output an inline SVG from an SVG image file.
.logo {
svg {
.cls-1{
fill:none;
stroke: get-color('primary');
}
.cls-2{
fill: get-color('primary');
}
}
@GarySwift
GarySwift / custom-menu-panel.php
Created May 13, 2017 16:57 — forked from nikolov-tmw/custom-menu-panel.php
This registers a custom meta box for nav menus and renders it. Obviously $my_items would ideally be not hard-coded and instead it would come somewhere from the DB. The custom items add to the menu and save properly, but will probably not be displayed correctly. You might need to hook to the 'wp_setup_nav_menu_item' filter in order to fix the men…
<?php
function my_register_menu_metabox() {
$custom_param = array( 0 => 'This param will be passed to my_render_menu_metabox' );
add_meta_box( 'my-menu-test-metabox', 'Test Menu Metabox', 'my_render_menu_metabox', 'nav-menus', 'side', 'default', $custom_param );
}
add_action( 'admin_head-nav-menus.php', 'my_register_menu_metabox' );
/**
@GarySwift
GarySwift / README.md
Last active April 30, 2018 08:57
Style for next and previous posts links. Adds font awesome icons to links. #FoundationPress #WordPress

Use Font Awesome to add Nav Arrows

Font Awesome 5 Update

.nav-next a:after, .nav-previous a:before  {
		font-family: 'Font Awesome\ 5 Free';
		font-weight: 900; /* Fix version 5.0.9 */
}
@GarySwift
GarySwift / _footer-2.scss
Last active September 21, 2017 11:14
Zurb Foundation 6 fix for WordPress default menu widget.(This is a fix used in Ole Fredrik Lie's FoundationPress https://github.com/olefredrik/FoundationPress)
@GarySwift
GarySwift / _top-bar.scss
Last active May 11, 2017 09:00
Use sass variables to style the Zurb Foundation 6 top-bar. This makes top-bar style a lot easier.
$darken-scale: 10%;
$topbar-color: $white;
$topbar-font-family: $body-font-family;
$topbar-font-weight: $global-weight-normal;
$topbar-bg-color: $primary-color;
$active-link-color: $topbar-color;
$active-link-bg-color: darken($topbar-bg-color, $darken-scale);// default is transparent
$active-link-hover-color: $topbar-bg-color;
$topbar-menu-border-type: none;
$topbar-menu-border-color: transparent;
@GarySwift
GarySwift / _magnific-popup-event-listener.js
Created May 4, 2017 09:04
Magnific Popup is a responsive lightbox & dialog script with focus on performance and providing best experience for user with any device.
/** ref: http://dimsemenov.com/plugins/magnific-popup/ */
jQuery(document).ready(function ($) {
var small='';
if (typeof site !== 'undefined') {
small = '<small>'+site.name+' - '+site.description+'</small>';
}
$('.lightbox-gallery').each(function() { // the containers for all your galleries
$(this).magnificPopup({
delegate: 'a.lightbox', // the selector for gallery item
type: 'image',
@GarySwift
GarySwift / 0_reuse_code.js
Created April 27, 2017 08:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@GarySwift
GarySwift / Zurb_Foundation_Color_Palette_Add_Colors.md
Last active July 31, 2020 10:08
Zurb Foundation Color Palette Add Colors

Adding to the Zurb Color Palette

This gist shows how you can add your own custom colors to the Zurb Foundation color palette.

They new colors can then be used to create custom buttons. The color sass variable is also avaliable using the get-color() function.

Reference

http://foundation.zurb.com/sites/docs/button.html