Skip to content

Instantly share code, notes, and snippets.

@aleua
aleua / oxygen-media-breakpoints-buttons.css
Created June 11, 2020 09:02 — forked from yankiara/oxygen-media-breakpoints-buttons.css
Direct access to Oxygen's media breakpoints
.oxygen-media-query-box-wrapper {
position: static;
}
.oxygen-sidebar-currently-editing {
position: relative;
padding-bottom: 48px;
}
.oxygen-media-query-box {
display: none;
}
@aleua
aleua / oxygen-repeater-dynamic-query.php
Created June 11, 2020 09:00 — forked from yankiara/oxygen-repeater-dynamic-query.php
Use dynamic queries with Oxygen's repeater
/*
* Example of related posts repeater for any CPT with taxonomy:
* - Filter query to prevent altering queries inside the repeater items,
* - Retrieve post category slug : I have only one for each post, so I just take first element.
* (You might need to add error tests, of course, if you don't accept empty results,
* for instance if you forgot to set post category.)
* - Set tax_query arg with category slug
* - Set random order
* - Exclude current post
* - Deactivate pagination
@aleua
aleua / modal.js
Created February 23, 2020 22:14 — forked from KittenCodes/modal.js
jQuery to create Lightbox popup using Oxygen's Modal element
jQuery('.lightbox-trigger').click( function() {
var image = jQuery(this).attr('src');
jQuery('.lightbox-popup').css('background-image', 'url(' + image + ')');
var caption = jQuery(this).next().text();
jQuery('.lightbox-popup-caption').text( caption );
@aleua
aleua / tab-element.js
Created June 26, 2019 09:15 — forked from wplit/tab-element.js
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');
@aleua
aleua / code.php
Created November 6, 2018 11:46 — forked from dtbaker/code.php
Add a custom control to an existing Elementor widget
// This example will add a custom "select" drop down to the "Image Box"
// This will change the class="" on the rendered image box so we can style the Image Box differently
// based on the selected option from the editor.
// The class will be "my-image-box-style-blue" or "my-image-box-style-green" based on the selected option.
add_action('elementor/element/before_section_end', function( $section, $section_id, $args ) {
if( $section->get_name() == 'image-box' && $section_id == 'section_image' ){
// we are at the end of the "section_image" area of the "image-box"
$section->add_control(
@aleua
aleua / header.scss
Created July 10, 2018 20:01 — forked from ahaywood/header.scss
WordPress: Mega Menu
/*------------------------------------*\
#PRIMARY-MENU
\*------------------------------------*/
.primary-menu {
@include grid;
@include sans-serif;
font-weight: $bold;
height: $nav-bar-height;
&__wrapper {
@charset 'UTF-8';
/* Slider */
.slick-loading .slick-list
{
background: #fff url('./ajax-loader.gif') center center no-repeat;
}
/* Icons */
@font-face
{
@aleua
aleua / WPR_Menu_Walker.php
Created January 31, 2018 23:25 — forked from artikus11/WPR_Menu_Walker.php
Walker под фреймворк UIKit 3
<?php
class WPR_Menu_Walker extends Walker_Nav_Menu {
public function start_lvl( &$output, $depth = 0, $args = array() ) {
if ( isset( $args->item_spacing ) && 'discard' === $args->item_spacing ) {
$t = '';
$n = '';
} else {
$t = "\t";
$n = "\n";
}
@aleua
aleua / Браузерное кеширование
Created January 31, 2018 23:24 — forked from artikus11/.htaccess
Заготовка для подключения браузерного кеширования
Включение кеша браузера
Вариант 1
<ifModule mod_headers.c>
<FilesMatch "\.(js|css|txt)$">
Header set Cache-Control "max-age=604800"
</FilesMatch>
<FilesMatch "\.(flv|swf|ico|gif|jpg|jpeg|png)$">
Header set Cache-Control "max-age=2592000"
@aleua
aleua / custom css
Created December 5, 2017 22:10 — forked from bigdigital/custom css
The7 Sticky Top Bar and Top bar on Mobile
.top-bar, .top-bar a, .top-bar .mini-nav .customSelect, .top-bar .mini-nav a:hover, .header-bottom-bar a {
color: #adb0b6 !important;
position: fixed !important;
width: 100% !important;
background: #fff none repeat center center !important;
z-index: 9999 !important;
top: 0;
}
.masthead {