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
/* | |
3 steps | |
1. Create the meta field | |
2. Display is in the admin area | |
3. Add a save feature that checks the nonce created in the display function | |
*/ | |
// add homepage meta box |
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 $image_data = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), "thumbnail" ); ?> | |
<?php $image_width = $image_data[1]; ?> | |
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 | |
/* | |
Template Name: Redirect To First Child | |
*/ | |
if (have_posts()) { | |
while (have_posts()) { | |
the_post(); | |
$pagekids = get_pages("child_of=".$post->ID."&sort_column=menu_order"); | |
$firstchild = $pagekids[0]; | |
wp_redirect(get_permalink($firstchild->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
<!-- SAMPLE MARKUP --> | |
<div class="section group"> | |
<div class="col span_1_of_12"> | |
1 of 12 | |
</div> | |
<div class="col span_1_of_12"> | |
1 of 12 | |
</div> | |
<div class="col span_1_of_12"> | |
1 of 12 |
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(window).scroll(function($) { | |
var scroll = $(window).scrollTop(); | |
if (scroll >= 500) { | |
$(".element").addClass("sample-class-to-add"); | |
} else { | |
$(".element").removeClass("sample-class-to-add"); | |
} | |
}); |
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
// track directions | |
jQuery('body').on("click", "a[href*='maps.google.com']", function(event) { | |
if (typeof gtag !== 'undefined') { | |
gtag('event', 'Click', { | |
'event_category': 'Contact', |
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(document).ajaxComplete(function() { | |
if (jQuery('.wpcf7-mail-sent-ok').length) { | |
if (typeof gtag !== 'undefined') { | |
gtag('event', 'Submit', { | |
'event_category': 'Contact Form', | |
'event_callback': function() { | |
console.log("contact form tracking sent successfully"); | |
} | |
}); |
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(document).on('click', "a[href^='tel:']", function(event) { | |
if (typeof gtag !== 'undefined') { | |
gtag('event', 'Click', { | |
'event_category': 'Contact', | |
'event_label': 'Phone', | |
'event_callback': function() { | |
console.log("phone tracking sent successfully"); | |
} | |
}); |
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
// for contact forms | |
jQuery('.quform-form').on('quform:successStart', function () { | |
gtag('event', 'isubmit', { 'event_category': 'Contact Forms' }); | |
}); |
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(ABSPATH . 'wp-admin/includes/ms.php'); | |
$user = get_userdatabylogin('YOUR_USERNAME'); | |
grant_super_admin($user->ID); | |
?> |