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
function acf_event_date( $atts ) | |
{ | |
// extract attributes | |
extract( shortcode_atts( array( | |
'field' => '', | |
'post_id' => false, | |
'format_value' => true, | |
'date_format' => '' | |
), $atts ) ); | |
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
add_shortcode( 'return_post_id', 'gimme_post_id' ); | |
function gimme_post_id() { | |
return get_the_ID(); | |
} |
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
/** | |
* Remove WooCommerce Lightbox | |
*/ | |
add_action( 'init', 'my_remove_lightbox' ); | |
function my_remove_lightbox() { | |
remove_theme_support( 'wc-product-gallery-lightbox' ); | |
} |
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
// ================================================================================================ | |
// FLIPPING THE GET SHORTCODE TO GET CATS IN A RESTRICTED FASHION ^CW | |
// ================================================================================================ | |
/** | |
* Eg : [getcats type="slug"] | |
* Shortcode for getting a list of categories from a current product category & restricted by product brand | |
* | |
* Shortcode attributes : | |
* type (optional): type of resultset values returned (slug or id) Default: slug |
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
/** | |
* Eg : [gettabs category="hydraulic" type="slug"] | |
* Shortcode for getting a list of tabs from a product category | |
* | |
* Shortcode attributes : | |
* type (optional): type of resultset values returned (slug or id) Default: slug | |
* category (required): slug of product category | |
* | |
* returns comma-separated string of tab slugs or tab ids | |
*/ |
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
/** | |
* First, remove WooCommerce Notices box from its default location on the page (somewhere at the top). | |
*/ | |
remove_filter( 'fl_theme_builder_before_render_content', 'FLThemeBuilderWooCommerceSingular::before_render_content' ); | |
/* You can now insert the store messages using the default WooCommerce shortcode -> [shop_messages] */ | |
/** | |
* OPTIONAL NEW SHORTCODE | |
* Create this shortcode : [fl_woocommerce_notices] |
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
// Dropping Woocommerce part because it's way faster! | |
// Here are two sources below with credit -- I'll add more as I find them | |
1.) Remove all products, categories, meta and relations | |
DELETE relations.*, taxes.*, terms.* | |
FROM wp_term_relationships AS relations | |
INNER JOIN wp_term_taxonomy AS taxes | |
ON relations.term_taxonomy_id=taxes.term_taxonomy_id | |
INNER JOIN wp_terms AS terms |
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
// In Beaver Builder, we want to inject the browser and platform into the HTML tag so we can target specific browsers and/or platform in a simple manner. | |
// Open Beaver Builder > Open Global Settings > Javascript Tab > Paste Below Snippet | |
// Credit: https://codepen.io/samiah/pen/NgQKMb | |
jQuery(function() { | |
var b = document.documentElement; | |
b.setAttribute('data-useragent', navigator.userAgent); | |
b.setAttribute('data-platform', navigator.platform ); | |
b.className += ((!!('ontouchstart' in window) || !!('onmsgesturechange' in window))?' touch':''); | |
}); |
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
// Add this to the Search and Pagination JS field. | |
// This will populate the dropdown (view filter) to set the state that the user is currently in. You can target any filter you have on the page. | |
// You will need to install the plugin CF Geo Plugin. They have shortcode and you can utilize JS for location attributes. | |
// Here we're changing a State dropdown for locations. Change to fit your project. | |
jQuery(document).ready(function () { | |
if(jQuery("body:not(.home) #wpv_control_select_wpcf-org-state option[selected='selected']").val() === "") { | |
var state = window.cfgeo.region; | |
var stateHandle = '#wpv_control_select_wpcf-org-state option[value="' + state + '"]'; | |
jQuery(stateHandle).attr('selected', true).trigger('change'); |
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
// This will go into the Search and Pagination JS box in toolset. It will exectue when the search results are updated. | |
// Change the .main-wrapper & and list-item to your classes. | |
jQuery( document ).on( 'js_event_wpv_parametric_search_results_updated', function( event, data ) { | |
var $wrapper = $('.main-wrapper'); | |
$wrapper.find('.list-item').sort(function (a, b) { | |
return +a.dataset.sort - +b.dataset.sort; | |
}) |