This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Custom functions for the use of the Advanced Custom Fields plugin. | |
* These are helper functions that you can include in your theme | |
* which make it easier to your ACF. The purpose is to allow the | |
* inclusion of ACF fields while also checking to see if ACF is | |
* installed and activated. With these functions you may be able to | |
* deactivate ACF for debugging and your theme will not throw | |
* errors. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form action="/cart/add" method="post"> | |
{% if product.variants.size > 1 %} | |
{% if product.options[0] %} | |
<label for="select-one">{{ product.options[0] }}</label> | |
<select id="select-one" onchange="letsDoThis()"> | |
{% for value in product.options_with_values[0].values %} | |
<option value="{{ value }}" {% if product.options_with_values[0].selected_value == value %}selected{% endif %}> | |
{{ value }} | |
</option> | |
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Homepage Settings for BigBang | |
Plugin URI: http://www.inboundnow.com/ | |
Description: Adds additional functionality to the big bang theme. | |
Author: David Wells | |
Author URI: http://www.inboundnow.com | |
*/ | |
// Specify Hooks/Filters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Minifies HTML and removes comments (except IE tags and comments within script tags) | |
* | |
* To disable compression of code portions, use '<!--wp-html-compression no compression-->' tag | |
* | |
* @see http://forrst.com/posts/Wordpress_Minify_output_HTML-29q | |
* @see http://www.intert3chmedia.net/2011/12/minify-html-javascript-css-without.html | |
*/ | |
class WP_HTML_Compression | |
{ | |
// Settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Paste into the end <head> | |
*/ | |
(function(){ | |
var width = screen.width; | |
var oldViewport = document.querySelector('meta[name="viewport"]'); | |
var viewport = document.createElement('meta'); | |
viewport.setAttribute('name', 'viewport'); | |
viewport.setAttribute('content', 'width=' + (width <= 640 ? '640' : 'device-width')); | |
document.head.replaceChild(viewport, oldViewport); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Move WooCommerce subcategory list items into | |
* their own <ul> separate from the product <ul>. | |
*/ | |
add_action( 'init', 'move_subcat_lis' ); | |
function move_subcat_lis() { | |
// Remove the subcat <li>s from the old location. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('wp_ajax_infinite_scroll_home', 'infinite_scroll_home', 0); | |
add_action('wp_ajax_nopriv_infinite_scroll_home', 'infinite_scroll_home'); | |
function infinite_scroll_home() { | |
$exclude_posts_json = $_POST['exclude_posts']; | |
$exclude_posts = json_decode($exclude_posts_json); | |
$post_offset = $_POST['post_offset']; | |
$infinite_scroll_args = array( 'post_type'=>'post', 'posts_per_page'=> 2,'post__not_in' => $exclude_posts, 'offset' => $post_offset); | |
$infinite_scroll_query = new WP_Query( $infinite_scroll_args ); | |
while( $infinite_scroll_query->have_posts() ) : $infinite_scroll_query->the_post(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form id="form-id"> | |
<div class="span6 form-table"> | |
<label for="usr">First Name <b>*</b></label> | |
<input name="first_name" type="text" class="form-control" id="usr" data-required="yes"> | |
<div class="cus-validation-error" style="display:none;"> | |
Please Enter Your First Name. | |
</div> | |
</div> | |
<div class="span6 form-table"> | |
<label for="">E-mail address<b>*</b></label> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function advanced_asyc_scripts($url) { | |
if ( strpos( $url, '#asyncload') === false ) { | |
return $url; | |
} else if ( is_admin() ) { | |
return str_replace( '#asyncload', '', $url ); | |
} else { | |
return str_replace( '#asyncload', '', $url )."' async='async' defer='defer"; | |
} | |
} |
NewerOlder