Skip to content

Instantly share code, notes, and snippets.

// http://stackoverflow.com/questions/18432577/stacked-tabs-in-bootstrap-3
.tabs-below, .tabs-right, .tabs-left {
.nav-tabs {
border-bottom: 0;
}
}
.tab-content > .tab-pane,
.pill-content > .pill-pane {
display: none;
@sharpmachine
sharpmachine / gist:5175fcd40ee5baa6e783
Created July 3, 2014 19:11
Copy ssh key to server
cat ~/.ssh/id_rsa.pub | ssh user@machine "mkdir ~/.ssh; cat >> ~/.ssh/authorized_keys"
@sharpmachine
sharpmachine / .htaccess
Created July 2, 2014 15:00
Increase upload size via .htaccess
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300
@sharpmachine
sharpmachine / current_tax.php
Created June 3, 2014 00:09
Get the Current Taxonomy of the Post using get_the_terms in WordPress
?php $terms = get_the_terms( $post->ID , 'Taxonomy Name' );
foreach ( $terms as $term ) {
$term_link = get_term_link( $term, 'Taxonomy Name' );
echo "<a href='".$term_link."'>" . $term->name . "</a>, ";
} ?>
@sharpmachine
sharpmachine / acf_rows.php
Created May 29, 2014 22:20
AFC rows and subfields
<?php if(get_field('team_members')): ?>
<?php while(has_sub_field('team_members')): ?>
<div class="row team-member">
<div class="col-sm-4">
<img src="<?php the_sub_field('team_member_headshot'); ?>" class="img-responsive img-circle" alt="<?php the_sub_field('team_member_name'); ?>">
</div>
<div class="col-sm-8">
<h3 class="team-member-name"><?php the_sub_field('team_member_name'); ?></h3>
<div class="team-member-position"><?php the_sub_field('team_member_title'); ?></div>
@sharpmachine
sharpmachine / gist:a0a50ec6c2a37aabc3a8
Last active August 29, 2015 14:01
Query Custom Post Types
<?php $args = array( 'post_type' => 'lastest_updates', 'showposts' => 1); ?>
<?php $latest_updates = new WP_Query( $args ); ?>
<?php if ( $latest_updates->have_posts() ) : ?>
<?php while ( $latest_updates->have_posts() ) : $latest_updates->the_post(); ?>
<?php the_short_title(35); ?> <a href="<?php the_permalink(); ?>" class="read-more">Read More &#8594;</a>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
@sharpmachine
sharpmachine / anchor.html
Last active August 29, 2015 14:01
Smooth page scrolling for anchors
<!-- Call -->
<a href="#branding">Branding</a>
<!-- Anchor -->
<div id="branding" class="anchor"></div>
@sharpmachine
sharpmachine / gist:8835575
Created February 5, 2014 23:31
Affix.js fix for when html, body { height: 100% }
Change the following is affix.js
From
this.$element.offset({ top: document.body.offsetHeight - offsetBottom - this.$element.height() })
To
this.$element.offset({ top: scrollHeight - offsetBottom - this.$element.height() })
<?php global $woocommerce; ?>
<a class="cart-contents" href="<?php echo $woocommerce->cart->get_cart_url(); ?>" title="<?php _e('View your shopping cart', 'woothemes'); ?>"><?php echo sprintf(_n('%d item', '%d items', $woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count);?> - <?php echo $woocommerce->cart->get_cart_total(); ?></a>
@sharpmachine
sharpmachine / no-update.php
Created January 1, 2014 18:03
Remove update notification for plugin
// Remove Update Notification
add_filter('site_transient_update_plugins', 'dd_remove_update_nag');
function dd_remove_update_nag($value) {
unset($value->response[ plugin_basename(__FILE__) ]);
return $value;
}