Skip to content

Instantly share code, notes, and snippets.

View mikeoberdick's full-sized avatar

Mike Oberdick mikeoberdick

View GitHub Profile
@mikeoberdick
mikeoberdick / genesis_custom_footer.php
Created May 6, 2016 15:26
A custom footer code snippet for the Genesis Framework
@mikeoberdick
mikeoberdick / genesis_utility_header.css
Created May 6, 2016 17:36
The PHP and CSS for the Genesis utility header
/* ## Utility Header
--------------------------------------------- */
.utility_header {
background-color: #00457c;
width: 100%;
}
.utility_header_wrap {
max-width: 1200px;
@mikeoberdick
mikeoberdick / sticky_header_on_scroll.js
Created May 6, 2016 17:37
Creates a jQuery sticky header on scroll
<script>
// Create a clone of the menu, right next to original
$('.site-header').addClass('original').clone().insertAfter('.site-header').addClass('cloned').css('position','fixed').css('top','0').css('margin-top','0').css('z-index','500').removeClass('original').hide();
scrollIntervalID = setInterval(stickIt, 10);
function stickIt() {
var orgElementPos = $('.original').offset();
orgElementTop = orgElementPos.top;
.search-form {
position: absolute;
right: -50px;
top: 2px;
}
.search-form input[type="search"] {
background-color: transparent;
background-image: url(/wp-content/uploads/2016/03/search_icon.png);
@mikeoberdick
mikeoberdick / frontend-builder-global-functions.js
Created May 18, 2016 13:52
Updated javascript file for the Divi submenu fix
(function($){
window.et_pb_smooth_scroll = function( $target, $top_section, speed, easing ) {
var $window_width = $( window ).width();
if ( $( 'body' ).hasClass( 'et_fixed_nav' ) && $window_width > 980 ) {
$menu_offset = $( '#top-header' ).outerHeight() + $( '#main-header' ).outerHeight() - 1;
} else {
$menu_offset = -1;
}
@mikeoberdick
mikeoberdick / divi_mobile_menu_fix.css
Last active March 11, 2019 05:18
A jQuery fix for the Divi Theme mobile menu that collapses all of the submenus
.et_mobile_menu .menu-item-has-children > a {
background-color: transparent;
}
#main-header .et_mobile_menu li ul.sub-menu.hide {
display: none !important;
visibility: hidden !important;
transition: all 1.5s ease-in-out;
}
@mikeoberdick
mikeoberdick / acf-widget.php
Created August 20, 2016 13:28
How to register an ACF widget area in WordPress
//The ACF widget
class ACF_Widget extends WP_Widget {
/**
* Register widget with WordPress.
*/
function __construct() {
parent::__construct(
'acf_widget', // Base ID
'Work Logos', // Name
@mikeoberdick
mikeoberdick / wp-config.php
Created August 22, 2016 12:21
Sample wp-config file
/** Set Post Revisions to 10 **/
define('WP_POST_REVISIONS', 10);
/** Disable the File Editor in Dashboard */
define('DISALLOW_FILE_EDIT', true);
/** Update the Auto Save to 2 hours */
define('AUTOSAVE_INTERVAL', 7200); //seconds
/** Update PHP Memory Limit */
@mikeoberdick
mikeoberdick / byf_footer.php
Last active March 27, 2017 08:50
Footer script for all Build Your Firm blogs.
#title a {
background: url(http://rossoncpa.com/blog/wp-content/uploads/2016/10/rosson-logo.jpg) no-repeat !important;
background-position: center !important;
background-size: contain !important;
float: left;
min-height: 80px;
width: 100%;
}