This file contains hidden or 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
AL : Alabama | |
AK : Alaska | |
AZ : Arizona | |
AR : Arkansas | |
CA : California | |
CO : Colorado | |
CT : Connecticut | |
DE : Delaware | |
DC : District of Columbia | |
FL : Florida |
This file contains hidden or 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', 'fs_only_do_on_homepage' ); | |
function fs_only_do_on_homepage() { | |
if( is_front_page() ) { | |
/* change the query to inject ads after every X frequency */ | |
// https://www.gowp.com/blog/inserting-custom-posts-loop/ | |
add_filter( 'the_posts', 'fs_insert_ads', 10, 2 ); |
This file contains hidden or 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 | |
// create shortcode to list all addresses of a "Location" Page Type | |
add_shortcode( 'fs-location-address-loop', 'fs_sc_location_address_loop' ); | |
function fs_sc_location_address_loop( $atts ) { | |
ob_start(); | |
// define attributes and their defaults | |
extract( shortcode_atts( array ( | |
'post_type' => 'page', |
This file contains hidden or 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 | |
// include only certain post types in the search results | |
function gc_filter_search($query) { | |
if (!$query->is_admin && $query->is_search) { | |
$query->set('post_type', array('post', 'page', 'book')); | |
} | |
return $query; | |
} | |
add_filter('pre_get_posts', 'gc_filter_search'); |
This file contains hidden or 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
(function($) { | |
// set the variables and ideal viewport height | |
$.fn.isInViewport = function() { | |
var elementTop = $(this).offset().top; | |
var elementBottom = elementTop + $(this).outerHeight(); | |
// viewport top starts at bottom of header height | |
var viewportTop = $(window).scrollTop() + 79; | |
// viewport bottom is the window height minus the header height (79) and sticky footer height (92) | |
var viewportBottom = ( viewportTop + $(window).height() ) - 171; |
This file contains hidden or 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
// Code for toggle function on product pages | |
jQuery(document).ready(function($) { | |
/* Divi Blurbs as Tabs */ | |
$('.tab-title').each(function () { | |
var section_id = $(this).find("a").attr("href"); | |
$(this).find("a").removeAttr("href"); | |
$(this).click(function() { | |
$(this).siblings().removeClass("active-tab"); | |
$(this).addClass("active-tab"); | |
$('.tab-content').hide(); |
This file contains hidden or 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 | |
// help make the plugin of WooCommerce Products Per Page work with the Divi Theme | |
add_action( 'pre_get_posts', 'fs_custom_posts_per_page', 30 ); | |
function fs_custom_posts_per_page( $query = false ) { | |
if ( is_admin() ) return; | |
if ( ! is_a( $query, 'WP_Query' ) || ! $query->is_main_query() ) return; | |
if ( $query->is_category ) { | |
$query->set( 'posts_per_page', apply_filters( 'loop_shop_per_page', 9 ) ); |
This file contains hidden or 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
// Code for inventory image | |
function inventoryTable(){ | |
// grab the URL in the new column and make into an image | |
jQuery('td.inventory-col-photo a').each(function () { | |
var image_anchor = jQuery(this).find("a"); | |
var image_url = jQuery(this).attr("href"); | |
//jQuery(this).prepend(jQuery('<img>',{class:'theImg',src:'theImg.png'})) | |
jQuery(this).html('<img src="' + image_url + '">'); | |
}); | |
// grab text in the Stock # column and assume its OK to make into a clickable image with that filename |
This file contains hidden or 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
jQuery(function($, undefined) { | |
// when the search form button is clicked | |
$("a.fs-partner-map-search-link").livequery("click", function() { | |
// get the ID of the button (which is the Maps ID) | |
var a = $("div.search_form_btn").attr("id"); | |
// if the search form container is visible, then proceed | |
if ( $("div.search_form_container_" + a).not(":visible") ) ( | |
$("div.search_form_container_" + a).removeClass("slideOutLeft").addClass("cspm_animated fadeInUp").css({ display: "block" }), | |
setTimeout(function() { $("form#search_form_" + a + " input[name=cspm_address]").focus() }, 400) | |
) |
This file contains hidden or 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 | |
/* shortcode that will output the Logout URL with Kiosk URL redirect, as anchor and text */ | |
// [fs_kiosk_logout_url_anchor class="whatever-it-is you-want"]Log Out[/fs_kiosk_logout_url_anchor] | |
add_shortcode( 'fs_kiosk_logout_url_anchor', 'fs_sc_kiosk_logout_url_anchor' ); | |
function fs_sc_kiosk_logout_url_anchor( $atts, $content = null ) { | |
// define attributes and their defaults | |
$a = shortcode_atts( array( | |
'class' => 'kiosk-logout-url-anchor' | |
), $atts ); | |