Skip to content

Instantly share code, notes, and snippets.

@galengidman
galengidman / uicolors.less
Last active August 29, 2015 14:13
getuicolors.com LESS variables
@uico-plum: #913d88;
@uico-seance: #9a12b3;
@uico-medium-purple: #bf55ec;
@uico-light-wisteria: #be90d4;
@uico-studio: #8e44ad;
@uico-wisteria: #9b59b6;
@uico-new-york-pink: #e08283;
@uico-pomegranate: #f22613;
@uico-red: #ff0000;
@uico-sunglo: #e26a6a;
<?php
function var_dump_pre( $var ) {
$str = "<pre>$var</pre>";
echo $str;
}
@galengidman
galengidman / functions.php
Last active August 29, 2015 14:02
WordPress post type and taxonomy setup for a knowledge base.
<?php
add_action( 'init', 'kb_register_post_types' );
function kb_register_post_types() {
register_post_type( 'kb_article', array(
'labels' => array(
'name' => 'Articles',
'singular_name' => 'Article',
'menu_name' => 'Knowledge Base',
@galengidman
galengidman / mailchimp.html
Last active August 29, 2015 14:01
MailChimp form in simplest form
<form action="[ACTION]" method="post" target="_blank">
<input type="email" name="EMAIL" placeholder="Email&hellip;">
<input type="text" name="[BLOCKER]" tabindex="-1" style="display: none;">
<input type="submit" value="Subscribe">
</form>
@galengidman
galengidman / index.php
Created May 9, 2014 22:26
Make sure cart total is can be updated as items are added live
<a href="<?php echo WC()->cart->get_cart_url(); ?>">
<span class="cart_totals"><?php echo WC()->cart->get_cart_total(); ?></span>
</a>
@galengidman
galengidman / index.php
Last active August 29, 2015 14:01
Only display cart link if cart has items
<?php if (sizeof(WC()->cart->get_cart()) != 0) : ?>
<a href="<?php echo WC()->cart->get_cart_url(); ?>">
<span class="cart_totals"><?php echo WC()->cart->get_cart_total(); ?></span>
</a>
<?php endif; ?>
@galengidman
galengidman / index.php
Created May 9, 2014 22:19
Using the cart total as the cart link text
<a href="<?php echo WC()->cart->get_cart_url(); ?>"><?php echo WC()->cart->get_cart_total(); ?></a>
@galengidman
galengidman / index.php
Created May 9, 2014 22:18
A simple link to the WooCommerce cart
<a href="<?php echo WC()->cart->get_cart_url(); ?>">Cart</a>
@galengidman
galengidman / functions.php
Last active August 29, 2015 13:57
register CTP with Dashicon
<?php
register_post_type('slide', array(
'label' => 'Slides',
'menu_icon' => 'dashicons-slides'
));
@galengidman
galengidman / index.html
Created March 28, 2014 18:56
.page-row markup for easy styling
<header class="page-row">
<!-- apply your styles to me -->
<div class="header-inner">
<h1>Site Title</h1>
</div>
</header>