Skip to content

Instantly share code, notes, and snippets.

@celsowhite
celsowhite / wp-clean-admin.php
Created August 2, 2017 14:37
Functions to clean admin dashboard menu and welcome screen.
<?php
/*---------------------
Dashboard Menu Adjustments
---------------------*/
// Only hide specific dashboard menu items on the live server.
// Show on localhost so we can control every component.
$whitelist = array('127.0.0.1','::1');
@celsowhite
celsowhite / modal.html
Last active July 24, 2023 17:10
Javascript Modal Starter Code - Enable multiple modals on the same page with a single script.
<a class="modal-trigger" data-modal="recap-video-modal">Recap Video</a>
<div class="modal recap-video-modal">
<div class="modal__transparent-layer modal-close"></div>
<div class="modal__content">
<p>Some content to go in the modal.</p>
</div>
<span class="close-icon modal-close"></span>
</div>
@celsowhite
celsowhite / flexslider_html_markup.html
Last active November 15, 2017 18:18
Flexslider markup for Otto code tutorial
<!-- Place somewhere in the <body> of your page -->
<div class="flexslider">
<ul class="slides">
<li>
<img src="homepage-banner-slide-1.jpg" />
</li>
<li>
<img src="homepage-banner-slide-2.jpg" />
</li>
@celsowhite
celsowhite / flexslider_otto_markup.html
Last active November 15, 2017 18:19
Flexslider using Otto liquid snippets
<div class="flexslider">
<ul class="slides">
<li>
{% include 'otto', location: 'homepage-banner-slide-1' %}
</li>
<li>
{% include 'otto', location: 'homepage-banner-slide-2' %}
</li>
<li>
{% include 'otto', location: 'homepage-banner-slide-3' %}
@celsowhite
celsowhite / otto-slideshow.liquid
Last active November 19, 2017 20:01
Shopify section code for creating Otto app slideshows.
{% comment %}
Otto Slideshow Section
---
Flexslider composed of Otto automated images.
Flexslider - https://woocommerce.com/flexslider/
{% endcomment %}
@celsowhite
celsowhite / .wp_htaccess
Last active July 12, 2019 19:49
Altered wordpress htaccess file to pull uploads from production
# Load media files from production server if they don't exist locally.
# Below snippet must be placed before wordpress default htaccess rules.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule wp-content/uploads/(.*) http://production-url.com/wp-content/uploads/$1 [NC,L]
</IfModule>
@celsowhite
celsowhite / custom_bullets.scss
Created January 16, 2018 19:08
Custom Bullets
/*==================================
Lists
---
General ul and ol elements within wysiwyg content areas having specific bullet or numbered styling.
The below styles create custom bullets and numbered lists. Bullets can be any image or unicode. Numbers can have a specific font style.
==================================*/
ul, ol {
margin: 0;
padding: 0;
@celsowhite
celsowhite / notification_bar.html
Last active October 28, 2021 23:53
Dismissible notifcations. Use local storage to allow users to hide notifications on a site. Notification only appears again if they clear their cookies.
<div class="notification_banner dismissible" id="store_locator_notification">
<p>Notification Content</p>
<div class="notification_dismiss_button" data-dismiss="store_locator_notification">
<i class="fas fa-times"></i>
</div>
</div>
@celsowhite
celsowhite / animate_in_view.js
Last active June 29, 2018 15:17
Function to check when an element is in view.
/*=================================
Animate In View
=================================*/
// Elements
const animatedElements = document.querySelectorAll('.animate_in_view');
// Check position of each element on scroll and animate