Skip to content

Instantly share code, notes, and snippets.

$color-dribbble: #ea4c89;
$color-facebook: #3b5998;
$color-flickr: #ff0084;
$color-googleplus: #dd4b39;
$color-instagram: #517fa4;
$color-linkedin: #007bb6;
$color-pinterest: #cb2027;
$color-tumblr: #32506d;
$color-twitter: #00aced;
$color-vimeo: #1ab7ea;
@JuanRangel
JuanRangel / helper-functions.php
Last active August 29, 2015 14:17
Get all terms from a taxonomy and use a select options
function get_tax_options( $taxonomy, $field ) {
$terms = get_terms( $taxonomy );
$current = ( isset($_POST[$field]) ) ? $_POST[$field] : '';
$options = array();
$options[] = '<option value="">-- ' . ucwords( $taxonomy ) .' --</option>';
if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){
foreach ( $terms as $term ) {
$options[] = sprintf( '<option value="%s" %s>%s</option>', $term->slug ,selected( $current, $term->slug ), $term->name );
}
@JuanRangel
JuanRangel / boiler
Created April 19, 2015 19:34
JavaScript Boilerplate
(function () {
'use strict';
}());
@JuanRangel
JuanRangel / style.scss
Created May 16, 2015 02:31
Main SCSS stylesheet
/*
Theme Name: THEME NAME
Theme URI: VSELLIS
Description: VSELLIS shoreline description.
Version: 1.0
Author: VSELLIS
Author URI: vsellis.com
Template: genesis
*/
@JuanRangel
JuanRangel / _themes.scss
Created May 16, 2015 03:27
Color Schemes
$theme-blue: #779ECB;
$theme-purple: #CA98C9;
$theme-red: #FF6861;
$theme-green: #89E894;
$theme-dark: #78797B;
.theme-blue {
.site-header,
@JuanRangel
JuanRangel / genesis-setup.php
Created May 16, 2015 03:36
Genesis setup file
// Priority 15 ensures it runs after Genesis itself has setup.
add_action( 'genesis_setup', 'theme_prefix_genesis_setup', 15 );
function theme_prefix_genesis_setup() {
//* Define Constants
//* Child theme (do not remove)
define( 'CHILD_THEME_NAME', 'Shoreline' );
define( 'CHILD_THEME_URL', 'http://vsellis.com/themes/shoreline' );
function $FUNCTION$() {
$END$
}
add_action( 'genesis_$ACTION$', '$FUNCTION$' );
<?php
class Widget_Name extends WP_Widget
{
protected $widget_slug = 'widget-slug';
public function __construct()
{
parent::__construct(
@JuanRangel
JuanRangel / customer-user.php
Created August 10, 2016 20:39
Add social fields to user profile
add_filter( 'user_contactmethods', 'vsellis_contactmethods' );
function vsellis_contactmethods( $contactmethods ) {
$contactmethods = [
'twitter' => 'Twitter',
'instagram' => 'Instagram',
'pinterest' => 'Pinterest',
'linkedin' => 'Linkedin',
'facebook' => 'Facebook',
];
@JuanRangel
JuanRangel / 0_reuse_code.js
Created January 30, 2017 19:57
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