Skip to content

Instantly share code, notes, and snippets.

View pixelloop's full-sized avatar

pixelloop

View GitHub Profile
@pixelloop
pixelloop / GTM on Genesis Framework
Created August 16, 2016 06:59 — forked from anandkumar/GTM on Genesis Framework
Google Tag Manager on Genesis
/**
* Add Add Google Tag Manager script on Genesis Framework
*
* @author Anand Kumar
* @link http://www.blogsynthesis.com/add-google-tag-manager-to-wordpress/#genesis-framework
*
*/
add_action('genesis_before', 'google_tag_manager');
function google_tag_manager() { ?>
<?php // Remove this line
/* Blog Intro */
add_action( 'genesis_before_loop', 'xgenesis_blog_intro' );
function xgenesis_blog_intro() {
$posts_page = get_option( 'page_for_posts' );
if ( !is_home() ) {
return;
}
$title = get_post( $posts_page )->post_title;
//* Add WooCommerce support
add_theme_support( 'genesis-connect-woocommerce' );
//* Add Yoast Breadcrumbs
add_action( 'loop_start', 'wordpress_seo_plugins_breadcrumbs' );
function wordpress_seo_plugins_breadcrumbs() {
if ( function_exists('yoast_breadcrumb') ) {
yoast_breadcrumb('<p id="breadcrumbs">','</p>');
}
}
// Add My Custom Functions File
include_once( get_stylesheet_directory() . '/custom/custom.php' );
//* Back To Top
add_action('wp_footer', 'go_to_top');
function go_to_top() {
?>
<script type="text/javascript">
jQuery(function($) {
$('.backtotop').click(function() {
$('html, body').animate({scrollTop:0}, 'slow');
<?php
/**
* Custom Functions
*/