Skip to content

Instantly share code, notes, and snippets.


Gabe Shackle hereswhatidid

View GitHub Profile
jawinn / primary_category.php
Last active Feb 1, 2020
Display Primary Category (Yoast's WordPress SEO)
View primary_category.php
$category = get_the_category();
$useCatLink = true;
// If post has a category assigned.
if ($category){
$category_display = '';
$category_link = '';
if ( class_exists('WPSEO_Primary_Term') )
rheinardkorf / Hooks.js
Last active Jul 31, 2020
Simple WordPress like hooks system for JavaScript.
View Hooks.js
* @file A WordPress-like hook system for JavaScript.
* This file demonstrates a simple hook system for JavaScript based on the hook
* system in WordPress. The purpose of this is to make your code extensible and
* allowing other developers to hook into your code with their own callbacks.
* There are other ways to do this, but this will feel right at home for
* WordPress developers.
View woocommerce-settings-tab-demo.php
* Plugin Name: WooCommerce Settings Tab Demo
* Plugin URI:
* Description: A plugin demonstrating how to add a WooCommerce settings tab.
* Author: Patrick Rauland
* Author URI:
* Version: 1.0
* This program is free software: you can redistribute it and/or modify
View bs3-stacked-tabs.less
.tabs-below, .tabs-right, .tabs-left {
.nav-tabs {
border-bottom: 0;
.tab-content > .tab-pane,
.pill-content > .pill-pane {
display: none;
bigdawggi / mailtrap-filter.php
Last active Jun 3, 2019
Mailtrap filter for WordPress
View mailtrap-filter.php
* Routes all email from WP installation to specific Mailtrap
* account inbox.
* All you need to do is change the "Username" and "Password"
* settings to the appropriate box in Mailtrap. Then all
* mail **should** be routed to that box. Exceptions would
* be other functionality that overwrite the wp_mail() functions
* and may not use this filter, or other filters that change
* this behavior after we set it, or millions of other things.
joelnet / example.html
Created Jun 3, 2011
Unobtrusive Knockout support library for jQuery
View example.html
Choose a ticket class: <select id="tickets"></select>
<p id="ticketOutput"></p>
<script id="ticketTemplate" type="text/x-jquery-tmpl">
{{if chosenTicket}}
You have chosen <b>${ chosenTicket().name }</b>
($${ chosenTicket().price })
<button data-bind="click: resetTicket">Clear</button>
You can’t perform that action at this time.