Skip to content

Instantly share code, notes, and snippets.

@galengidman
galengidman / text-inputs.css
Created March 18, 2014 16:11
Elements to target to style text inputs.
input[type="email"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="text"],
input[type="url"],
textarea {
/* styles */
}
@galengidman
galengidman / menu.html
Created March 28, 2014 15:43
Statamic Menu
<ul id="menu" class="menu">
{{ if menu }}
{{ menu }}
<li{{ if submenu }} class="has-submenu"{{ endif }}>
<a href="{{ url }}"{{ if target }} target="{{ target }}"{{ endif }}>{{ name }}</a>
{{ if submenu }}
<ul class="submenu">
{{ submenu }}
<li><a href="{{ url }}"{{ if target }} target="{{ target }}"{{ endif }}>{{ name }}</a></li>
@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>
@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.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 / 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
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: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 / 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 / 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',