Skip to content

Instantly share code, notes, and snippets.

View amandalucas's full-sized avatar

Amanda Lucas amandalucas

View GitHub Profile
@wplit
wplit / snippet.php
Created July 26, 2021 01:59
Prevent redirect if WP login form failed
// Prevent redirect if login form failed
add_action( 'wp_login_failed', 'my_front_end_login_fail' );
function my_front_end_login_fail( $username ) {
$referrer = $_SERVER['HTTP_REFERER'];
if ( !empty($referrer) && !strstr($referrer,'wp-login') && !strstr($referrer,'wp-admin') ) {
wp_redirect( $referrer . '?login=failed' );
exit;
}
}
@wplit
wplit / code-block.js
Last active March 17, 2021 23:27
add status to carousel builder (add to code block)
jQuery(document).ready(function($) {
let carouselSelector = '.my-carousel'; /* Change to your carousel class */
let statusSelector = '.oxy-carousel-builder_status'; /* Change to your text component class */
let $carousel = $(carouselSelector).find($(carouselSelector).children().data('carousel'));
var flkty = $carousel.data('flickity');
if (flkty) {
function updateStatus() {
@tdrayson
tdrayson / FF-image-radio-field.css
Last active June 27, 2022 05:29
Fluent Forms Image Radio Field CSS
/**
* Styles the Radio field as clickable image for Fluent Forms
*
* Use: Paste into Custom CSS Section of your Form
* Add class "fancy-input" to container of all inputs that need the fancy styling
*
* Forked version of Sebastian Berger from inital post Fluent Forms FB Group - https://bit.ly/37BBpet
* FB Post - https://bit.ly/2ZEn2BG
*
* Full Links at bottom
@wplit
wplit / style.css
Last active February 3, 2021 10:19
amanda burger sync
.oxy-burger-trigger .hamburger--slider.is-active .hamburger-inner {
transform: none;
}
.oxy-burger-trigger .hamburger--slider.is-active .hamburger-inner::before {
transform: none;
opacity: 1;
}
.oxy-burger-trigger .hamburger--slider.is-active .hamburger-inner::after {
@wplit
wplit / code block js
Last active July 23, 2021 00:13
allow carousel builder to work inside tabs
jQuery(document).ready(function($) {
if(window.angular) return;
$('.oxy-tabs').on('click', function() {
let tabContent = '#' + $(this).attr('data-oxy-tabs-contents-wrapper');
let carousels = $(tabContent).find('.oxy-carousel-builder');
carousels.each(function() {
@wplit
wplit / code block
Created June 6, 2020 12:02
make sure offcanvas closes when menu item clicked if hashlink
jQuery('.oxy-off-canvas .menu-item a[href*=\\#]').on('click', function (event) {
if(this.pathname === window.location.pathname){
jQuery('body').removeClass('off-canvas-toggled');
jQuery('.oxy-off-canvas').removeClass('oxy-off-canvas-toggled');
jQuery(jQuery('.offcanvas-inner').data('trigger-selector')).find('.hamburger').removeClass('is-active');
}
});
@yankiara
yankiara / gutenberg-columns-gap.css
Created April 13, 2020 10:55
Custom Gutenberg columns gap
:root {
--columns-gap: 1rem;
}
@media (min-width:782px) {
.wp-block-column:not(:first-child) {
margin-left: var(--columns-gap);
}
}
@media (min-width:600px) and (max-width:781px) {
@wplit
wplit / tab-element.js
Last active December 14, 2022 09:57
Allow hash links to open tabs in Oxygen (read comments for instructions)
var hash = window.location.hash.substr(1);
if (hash == '%%ELEMENT_ID%%') {
setTimeout(function(){
jQuery([document.documentElement, document.body]).animate({
scrollTop: jQuery('#' + '%%ELEMENT_ID%%').offset().top - 100
}, 1000);
jQuery('#' + '%%ELEMENT_ID%%').trigger('click');
.btn-inline .et_pb_button_module_wrapper {
display: inline-block;
margin: 0 5px;
}
.btn-inline {
text-align: center !important;
}
@robhob
robhob / grid-zoom.css
Last active January 9, 2018 11:27
Create a row with as many columns as you want, give each column the CSS Class name of my_col. Under the Advanced tab of the row go to the Custom CSS section and add border: 1px solid #eaeaea; to the main element of each columns custom CSS. Add the CSS of this gist to your custom CSS.
/* For when the mouse moves on to the image */
.brands img:hover {
-webkit-transform: scale(.65) translateY(-4px);
-ms-transform: scale(.65) translateY(-4px);
transition: all .4s ease-in-out;
transform: scale(1.2) translateY(-4px);
}
/* For when the mouse moves off the image */
.brands img {