Skip to content

Instantly share code, notes, and snippets.

View cjwd-snippets's full-sized avatar

cjwd-snippets

View GitHub Profile
@cjwd-snippets
cjwd-snippets / readme.md
Created March 9, 2017 15:58
Starter readme file for my WordPress themes

General Information

This project uses the Gitflow Worflow.

You can learn more here

There are two branches Master and Dev. You will only need to concern yourself with the Dev branch.

The Dev branch will be used to integrate all the themes changes/features.

Getting Started

@cjwd-snippets
cjwd-snippets / .gitignore
Created July 24, 2017 15:10
Gitignore for Siteground
*~
.DS_Store
.svn
.cvs
*.bak
*.swp
Thumbs.db
# wordpress specific
wp-config.php
@cjwd-snippets
cjwd-snippets / template-hooks.php
Created August 15, 2017 18:19
WooCommerce: Hides checkout fields based on the products in the cart
/**
* Hides checkout fields based on the products in the cart
*
* @param array $fields
* @return array
*/
function conditional_checkout_fields_products( $fields ) {
$cart = WC()->cart->get_cart();
foreach ( $cart as $item_key => $values ) {
@cjwd-snippets
cjwd-snippets / is_piklist_activated.php
Created September 29, 2017 16:45
Check if piklist is activated
/**
* This plugin depends on Piklist
*
* Is the piklist plugin activated?
*
* @since 1.0.0
*/
public function is_piklist_activated() {
if( is_admin() ) {
@cjwd-snippets
cjwd-snippets / caribbeanmiles.json
Created March 5, 2018 21:26
Base miles for caribbean country pairs
[
{
"Origin": "Antigua",
"Destination": "Barbados",
"Base Miles": "831"
},
{
"Origin": "Antigua",
"Destination": "Grenada",
"Base Miles": "831"
@cjwd-snippets
cjwd-snippets / grid.scss
Created February 16, 2019 16:25
CSS Grids using minmax
$col: calc((1200px - (11 * 10px)) / 12); // ($wrapperWidth - ($numberOfGutters * $gutterWidth)) / $numberOfColumns
.grid {
display: grid;
}
.grid-12 {
display: grid;
grid-template-columns: minmax(20px, 1fr) repeat(12, minmax(auto, $col)) minmax(20px, 1fr);
grid-gap: 10px;