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
jQuery(function($){ | |
let canBeLoaded = true, | |
bottomOffset = 2000; | |
$(window).on( 'scroll', function(){ | |
let data = { | |
'action': 'loadmore', | |
'query': ajaxposts.posts, | |
'page' : ajaxposts.current_page | |
}; |
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( | |
'wpcf7_init', | |
function () { | |
wpcf7_add_form_tag( array( 'dd_states', 'dd_states*' ), 'cf7_state_dropdown', true ); | |
} | |
); | |
/** | |
* Custom Select Form Tag Callback for Contact Form 7. | |
* |
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
AB : Alberta | |
BC : British Columbia | |
MB : Manitoba | |
NB : New Brunswick | |
NL : Newfoundland and Labrador | |
NT : Northwest Territories | |
NS : Nova Scotia | |
NU : Nunavut | |
ON : Ontario | |
PE : Prince Edward Island |
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 dd_modal_link( $atts ) { | |
$atts = shortcode_atts( array( | |
'text' => '', | |
'target' => '', | |
'class' => '', | |
), $atts, 'dd_modal_link' ); | |
$output = '<a href="#' . $atts[ 'target' ] . '"'; | |
if ( $atts[ 'class' ] ) { |
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_filter('dd_filter_owl_carousel_script', 'custom_owl_carousel_filter', 10, 2); | |
function custom_owl_carousel_filter($owl_script, $carousel_id){ | |
// Put your carousel ID in place of 123 both on lines 4 and line 7 | |
if ($carousel_id !== 123) return $owl_script; | |
$owl_script =" | |
jQuery(function($){ | |
$('#carousel-123').owlCarousel({ | |
'autoHeight' :true, // Added this property | |
'loop':true, | |
'autoplay' : true, |
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 | |
class Adv_Reg_WC_Endpoint { | |
/** | |
* Custom endpoint name. | |
* | |
* @var string | |
*/ | |
public static $registrations = 'registered-products'; |
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 get_us_state_options($selected = '') { | |
?> | |
<select name="state" id="state"> | |
<option value="" >Select a State</option> | |
<option value="AL"<?php selected($selected, 'AL') ?>>Alabama</option> | |
<option value="AK"<?php selected($selected, 'AK');?>>Alaska</option> | |
<option value="AZ"<?php selected($selected, 'AZ');?>>Arizona</option> | |
<option value="AR"<?php selected($selected, 'AR');?>>Arkansas</option> | |
<option value="CA"<?php selected($selected, 'CA');?>>California</option> |
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('wpcf7_init', function (){ | |
wpcf7_add_form_tag( 'country_name' , 'cf7_ip_to_country_form_tag' ); | |
}); | |
function cf7_ip_to_country_form_tag($tag){ | |
// Your API Key for https://ipstack.com | |
$api_key = 'your_api_key'; | |
// Get API Response | |
$url = 'http://api.ipstack.com/' . $_SERVER['REMOTE_ADDR'] . '?access_key=' . $api_key; |
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 | |
// include in functions.php or in a plugin. | |
// Use var_export, print_r, var_dump, whatever | |
add_action( 'wpcf7_before_send_mail', 'he_debug_cf7_output'); | |
function he_debug_cf7_output( $contact_form ) { | |
$submission = WPCF7_Submission::get_instance(); | |
if ( $submission ) { | |
$posted_data = $submission->get_posted_data(); | |
// Dump output to error log |
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="contact" class="form-request" method="post" name="contact_form" action="process-form.php"> | |
<input type="text" name="name" placeholder="Your Name:"> | |
<input type="text" name="email" placeholder="Your Email:"> | |
<input type="text" name="phone" placeholder="Your Phone:"> | |
<textarea name="message" placeholder="Your Message:"></textarea> | |
<div class="g-recaptcha mb-3" data-sitekey="site_key"></div> | |
<input class="btn-submit" type="submit" value="Contact Dive Patches"> | |
</form> | |
<div id="response"></div> |
NewerOlder