Skip to content

Instantly share code, notes, and snippets.

View jstnbr's full-sized avatar

Justin Breen jstnbr

View GitHub Profile
@jstnbr
jstnbr / wp-start.sh
Created June 1, 2019 17:29 — forked from ethicka/wp-start.sh
WordPress Installation with the Roots/Sage Framework and VirtualHost Creation
#!/bin/bash -e
##
# WordPress Installation and VirtualHost Creation
#
# Description: Installs a WordPress website in the ~/Sites folder, creates a homepage,
# cleans up the WP install a bit, deletes the akismet and hello dolly plugins, creates the permalinks,
# clones the roots/sage theme framework to the theme folder, deletes all the other WP default themes,
# installs/runs npm and bower and runs gulp to create the initial assets, adds a custom gitignore file
# to /wp-content, installs the roots/soil plugin, creates a git repo in wp-content, saves the WordPress
@jstnbr
jstnbr / wordpress-dev.sh
Created June 1, 2019 16:37 — forked from techkram/wordpress-dev.sh
WordPress Development Script
# wordpress-dev.sh
#
# Copyright 2012 Frank Lewandowski <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@jstnbr
jstnbr / open-graph-protocol-head-info.php
Created June 22, 2018 18:06
Setup Open Graph Protocol data by adding this code to the document head.
<?php if ( has_post_thumbnail() ) : ?>
<meta property="og:image" content="<?php echo get_the_post_thumbnail_url( get_the_ID(), 'large' ); ?>">
<meta property="og:image:secure_url" content="https://newportshimodablackships.com/wp-content/uploads/2018/06/lanterns-background-1200x630.jpg">
<meta property="og:image:type" content="image/jpeg">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:image:alt" content="<?php the_title(); ?> - <?php bloginfo( 'name' ); ?>">
<?php endif; ?>
@jstnbr
jstnbr / Custom Excerpt.php
Created February 26, 2018 05:31
Generate a custom excerpt in Wordpress.
<?php
/**
* Custom Excerpt
*
* @param array $args {
* Optional. Array of excerpt() arguments.
*
* @type int $limit Limit result to amount. Default '55'.
* @type string $limitby Limit by either word or character. Default 'word'. Accepts 'char', 'word'.
/**
* easyListSplitter 1.0.2
* Copyright (c) 2010 Andrea Cima Serniotti (http://www.madeincima.eu)
* Dual licensed under MIT and GPL
*/
/**
* Usage:
*
@jstnbr
jstnbr / 0_reuse_code.js
Created November 9, 2016 21:14
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