View template-redirect-child.php
<?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));
View functions.php
// Include the Google Analytics Tracking Code
function google_analytics_tracking_code(){ ?>
<!-- script from analytics starts here -->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-68863234-2"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
View HTML And CSS
<!-- 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
View scroll-add-class.js
jQuery(window).scroll(function($) {
var scroll = $(window).scrollTop();
if (scroll >= 500) {
$(".element").addClass("sample-class-to-add");
} else {
$(".element").removeClass("sample-class-to-add");
}
});
View functions.php
// track directions
jQuery('body').on("click", "a[href*='maps.google.com']", function(event) {
if (typeof gtag !== 'undefined') {
gtag('event', 'Click', {
'event_category': 'Contact',
View functions.php
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");
}
});
View functions.php
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");
}
});
View functions.php
// for contact forms
jQuery('.quform-form').on('quform:successStart', function () {
gtag('event', 'isubmit', { 'event_category': 'Contact Forms' });
});
View functions.php
<?php
include(ABSPATH . 'wp-admin/includes/ms.php');
$user = get_userdatabylogin('YOUR_USERNAME');
grant_super_admin($user->ID);
?>
View function.php
// Disable support for comments and trackbacks in post types
function lf_disable_comments_post_types_support() {
$post_types = get_post_types();
foreach ($post_types as $post_type) {
if(post_type_supports($post_type, 'comments')) {
remove_post_type_support($post_type, 'comments');
remove_post_type_support($post_type, 'trackbacks');
}
}