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 | |
// option 1, to change text site wide | |
add_filter( 'gettext', 'fs_translate_strings_1', 20, 3 ); | |
function fs_translate_strings_1( $translation, $text, $domain ) { | |
// STRING 1 | |
$translation = str_ireplace( 'My Old Text', 'My New Text', $translation ); | |
// STRING 2 | |
$translation = str_ireplace( 'Old Text', 'New text', $translation ); | |
return $translation; |
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 // remove this line | |
// add this to your wp-config.php file, before /* That's all, stop editing! Happy blogging. */ | |
define( 'WP_DEBUG', true ); | |
if (WP_DEBUG) { | |
define('WP_DEBUG_LOG', true); | |
define('WP_DEBUG_DISPLAY', false); | |
@ini_set('display_errors',0); | |
} |
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 ); | |
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
// 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
<?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 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
(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
<?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
<?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', |