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 | |
// merge tag for Job Application Category | |
add_action( 'gform_admin_pre_render', 'sls_add_merge_tags' ); | |
function sls_add_merge_tags( $form ) { | |
?> | |
<script type="text/javascript"> | |
gform.addFilter('gform_merge_tags', 'add_merge_tags'); | |
function add_merge_tags(mergeTags, elementId, hideAllFields, excludeFieldTypes, isPrepop, option){ | |
mergeTags["custom"].tags.push({ tag: '{embededPostCat}', label: 'Embeded Post Category' }); |
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 | |
/** | |
* Check if WooCommerce is active | |
**/ | |
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) { | |
// remove product thumbnail and title from the shop loop | |
remove_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10 ); | |
remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 ); | |
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
var $findit = jQuery('#visualisation'); // element that needs to be in view for thing to happen | |
function Scrolledit() { | |
$findit.each(function() { | |
var $section = jQuery(this), | |
finditOffset = $section.offset(), | |
finditTop = finditOffset.top, | |
finditBottom = $section.height() + finditTop, | |
scrollTop = jQuery(document).scrollTop(), | |
visibleBottom = window.innerHeight, |
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 this code to the functions.php file of your Theme or Child Theme | |
/* | |
* Add Custom tabs to WooCommerce products which contain content stored in custom fields (product postmeta fields) | |
* This example is adding 3 tabs. Product Instructions, Size Chart, and Tech Specs | |
* There are 2 pieces that are needed: | |
* 1. Declare the tab | |
* 2. Declare the contents of the tab | |
* Recommended to use ACF (advanced custom fields plugin) to managage the tab content per product. |
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
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) { | |
remove_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10 ); | |
remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 ); | |
add_action( 'woocommerce_before_shop_loop_item_title', 'sls_woocommerce_template_loop_product_thumbnail', 10 ); | |
function sls_woocommerce_template_loop_product_thumbnail() { | |
echo '<a class="thumbnail" title="'.get_the_title().'" href="'. get_the_permalink() . '">'.woocommerce_get_product_thumbnail().'</a>'; | |
echo '<h3><a href="'.get_the_permalink().'">'.get_the_title().'</a></h3>'; | |
} |
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 | |
function acf_set_featured_image( $value, $post_id, $field ){ | |
if($value != '' && 'location' == get_post_type()){ | |
//Add the value which is the image ID to the _thumbnail_id meta data for the current post | |
update_post_meta($post_id, '_thumbnail_id', $value); | |
} | |
return $value; |
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 | |
// This code should be added to the functions.php file of the child theme | |
// Add custom info to Additional Information product tab | |
add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 ); | |
function woo_rename_tabs( $tabs ) { | |
global $product; | |
$tabs['additional_information']['callback'] = 'custom_function_name'; // this is the function name which is included below | |
return $tabs; | |
} |
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 | |
/* Bootstrap Docs: | |
* http://getbootstrap.com/javascript/#modals | |
* Lots of options could be added as attributes in the shortcode. The attached code is just the pieces I needed at the time. | |
* This is the simple shortcode: | |
* [sls-modal id="modal-1" header_text="HEADER TITLE HERE"] | |
* CONTENT HERE | |
* [/sls-modal] | |
* One thing that should be changed, is to allow for other respondo shortcode to be used within the content part. | |
* I hadn't shorted that out yet. |
OlderNewer