Skip to content

Instantly share code, notes, and snippets.

View JoelEadeDesign's full-sized avatar

Joel Eade JoelEadeDesign

View GitHub Profile
@mishterk
mishterk / bypass-elementors-maintenance-mode.php
Last active April 4, 2024 13:29
Using this snippet, you can bypass Elementor's maintenance mode by adding ?bypass_maintenance=1 to the query string
<?php
add_filter( 'pre_option_elementor_maintenance_mode_mode', function ( $option ) {
$parameter = 'bypass_maintenance'; // change this to whatever you like
if ( isset( $_GET['bypass_maintenance'] ) and $_GET['bypass_maintenance'] ) {
return 0; // needs to be falsy but not FALSE
}
@paullacey78
paullacey78 / gp-header-patch.css
Created August 1, 2017 11:55
GeneratePress header fix for logo/nav overlap
/* GeneratePress Header fix for problem break points
Change the 900px value in two places to where you have nav/logo overlap */
@media(min-width:768px) AND (max-width:900px) {
.inside-header {
display: flex;
flex-flow: row wrap;
justify-content: center;
}
#site-navigation {
min-width: 900px;
@generatepress
generatepress / gist:d8211a277d13fa095849
Created October 5, 2015 07:24
Make the mobile menu slide up and down
<script>
jQuery( document ).ready( function( $ ) {
$( '.menu-toggle' ).addClass( 'closed' );
$( document ).on( 'click', '.menu-toggle.closed', function() {
var sub = $( this ).next( '.main-nav' ).children( 'ul' );
sub.hide();
sub.slideDown();
$( this ).removeClass( 'closed' );
$( this ).addClass( 'opened' );
});
@generatepress
generatepress / gist:c23aef2d05807c39bb32
Last active January 14, 2019 22:35
Initiate the mobile menu at your desired width
@media (max-width: 768px) {
.main-navigation .menu-toggle,
.main-navigation .mobile-bar-items,
.sidebar-nav-mobile:not(#sticky-placeholder) {
display: block;
}
.main-navigation ul,
.gen-sidebar-nav {
display: none;
@schmidt1024
schmidt1024 / svg.js
Created June 3, 2015 13:59
Replace all SVG images with inline SVG using jQuery
/*
* Replace all SVG images with inline SVG
*/
jQuery('img.svg').each(function(){
var $img = jQuery(this);
var imgID = $img.attr('id');
var imgClass = $img.attr('class');
var imgURL = $img.attr('src');
jQuery.get(imgURL, function(data) {
@mattradford
mattradford / acf_get_directions.php
Last active February 16, 2023 12:08
ACF Get Directions map link
<?php
$location = get_field('map_location');
if ( !empty( $location ) ) :
$map_url = 'https://www.google.com/maps/dir/?api=1&destination=' . $location['lat'] . ',' . $location['lng'];
echo '<a href=". esc_url( $map_url ) . '" rel="nooopener">Get directions</a>';
endif;
?>
<p>This should produce a link like this:</p>
<a href="https://www.google.com/maps/dir/?api=1&destination=51.072159,1.088130">Get directions</a>
@webaware
webaware / gravity-forms-fields-above.php
Created May 12, 2014 03:39
Move Gravity Forms field labels from below to above fields in compound fields (e.g. Address, Name)
<?php
/*
Plugin Name: Gravity Forms Fields Above
Plugin URI: https://gist.github.com/webaware/24e1bacb47b76a6aee7f
Description: move field labels from below to above fields in compound fields (e.g. Address, Name)
Version: 1
Author: WebAware
Author URI: http://webaware.com.au/
@link http://www.gravityhelp.com/forums/topic/change-position-of-sub-labels-on-advanced-fields
@Laszaro
Laszaro / typography-scales.css
Created October 11, 2013 14:03
CSS - Typography Scales
/*
Source: http://typecast.com/blog/contrast-through-scale
The 16th century scale:
6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 21, 24, 26, 48, 60, 72
*/
body { font-size:100%; }
h1 { font-size: 2.25em; /* 16 x 2.25 = 36 */ }
h2 { font-size: 1.5em; /* 16 x 1.5 = 24 */ }
@HoundstoothSTL
HoundstoothSTL / anchor-scroll-with-offset.js
Created May 3, 2013 15:43
Anchor scroll with fixed header offset
(function($) {
$('a[href*=#]:not([href=#])').click(function()
{
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
|| location.hostname == this.hostname)
{
var target = $(this.hash),
headerHeight = $(".primary-header").height() + 5; // Get fixed header height