Skip to content

Instantly share code, notes, and snippets.

@galengidman
galengidman / text-inputs.css
Created Mar 18, 2014
Elements to target to style text inputs.
View text-inputs.css
input[type="email"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="text"],
input[type="url"],
textarea {
/* styles */
}
View menu.html
<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 / functions.php
Last active Aug 29, 2015
register CTP with Dashicon
View functions.php
<?php
register_post_type('slide', array(
'label' => 'Slides',
'menu_icon' => 'dashicons-slides'
));
@galengidman
galengidman / index.html
Created Mar 28, 2014
.page-row markup for easy styling
View index.html
<header class="page-row">
<!-- apply your styles to me -->
<div class="header-inner">
<h1>Site Title</h1>
</div>
</header>
@galengidman
galengidman / index.php
Created May 9, 2014
A simple link to the WooCommerce cart
View index.php
<a href="<?php echo WC()->cart->get_cart_url(); ?>">Cart</a>
@galengidman
galengidman / index.php
Created May 9, 2014
Using the cart total as the cart link text
View index.php
<a href="<?php echo WC()->cart->get_cart_url(); ?>"><?php echo WC()->cart->get_cart_total(); ?></a>
@galengidman
galengidman / index.php
Last active Aug 29, 2015
Only display cart link if cart has items
View index.php
<?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
Make sure cart total is can be updated as items are added live
View index.php
<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 Aug 29, 2015
MailChimp form in simplest form
View mailchimp.html
<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 Aug 29, 2015
WordPress post type and taxonomy setup for a knowledge base.
View functions.php
<?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',
You can’t perform that action at this time.