Skip to content

Instantly share code, notes, and snippets.

@jillmugge
jillmugge / shrink-header.css
Created March 10, 2016 14:29
This is my alternative to Nathan's shrinking header
.header {
background-color:rgba(255, 255, 255, 0.7);
position: fixed;
width: 100%;
z-index: 1;
}
/* Second Module Offset */
.hero-text {
@jillmugge
jillmugge / functions.php
Last active October 13, 2016 15:04
Adding a Child Theme to Divi style.css and functions.php. Add a child folder in /wp-content/themes/..
<?php
add_action( 'wp_enqueue_scripts', 'my_enqueue_assets' );
function my_enqueue_assets() {
wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
}
@jillmugge
jillmugge / function.php
Last active October 13, 2016 17:42
Hero full browser screen image. Add #hero to img. enqueue script in functions.php
//Enqueue
add_action( 'wp_enqueue_scripts', 'jmg_enqueue_all' );
function jmg_enqueue_all() {
wp_register_script( 'hero', get_stylesheet_directory_uri().'/js/hero.js');
wp_enqueue_script('hero', get_template_directory_uri().'/js/hero.js', array('jquery'), false, true);
}
@jillmugge
jillmugge / new_gist_file-v2.php
Created June 2, 2017 15:41
Add FB Pixel to head via functions.php for WP to exclude your IP address in FB metrics
add_action( 'wp_head', 'child_theme_head_script' );
function child_theme_head_script() {
if ( $_SERVER['REMOTE_ADDR'] != '73.153.255.49' ) {
?>
<!--Facebook Pixel Code-->
<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,