Skip to content

Instantly share code, notes, and snippets.

@KrisKnez
KrisKnez / custom-image-sizes.php
Created May 5, 2022 18:20
Custom Image Sizes For Wordpress
<?php
add_image_size( 'image-480', 480, 9999 );
add_image_size( 'image-640', 640, 9999 );
add_image_size( 'image-720', 720, 9999 );
add_image_size( 'image-960', 960, 9999 );
add_image_size( 'image-1168', 1168, 9999 );
add_image_size( 'image-1440', 1440, 9999 );
add_image_size( 'image-1920', 1920, 9999 );
@KrisKnez
KrisKnez / modal-open-disable-scroll.js
Last active May 5, 2022 18:17
Oxygen Builder Disable Scrolling On Modal Open With Pure JS using MutationObserver
function DisableEvent(e) {
e.preventDefault();
e.stopPropagation();
return false;
}
new MutationObserver(function(e) {
let isMobile = window.innerWidth - document.body.offsetWidth < 10;
if (e[0].target.classList.contains("live")) {
if (isMobile)
@KrisKnez
KrisKnez / next.config.js
Created March 8, 2022 23:51
Sample of a webpack video loader configuration for Next.JS
const nextConfig = {
webpack: function (config, options) {
config.module.rules.push({
test: /\.mp4$/,
use: [
{
loader: "file-loader",
options: {
name: "[name].[ext]",
outputPath: "static/media",