Skip to content

Instantly share code, notes, and snippets.

View bahia0019's full-sized avatar

William Bay bahia0019

View GitHub Profile
<?php
/**
* Plugin Name: Remove Video Mimes
* Author: Flaunt Your Site
* Version: 1.0
* Author URI: http://flauntyoursite.com
* Description: Removes Video mime tyoe for all plans except Premium.
*/
@bahia0019
bahia0019 / hex-to-rgba.php
Created September 20, 2018 21:23
Convert Hex string to RGBA
<?php
/**
* Take Accent color, and convert it to RGBA, and add an opacity of .75.
*/
$accent = get_theme_mod( 'site_accent_color' );
$accent_string = ltrim( $accent, '#' );
$arr = str_split( $accent_string, '2' );
foreach ( $arr as $value ) {
$new_value = hexdec( $value ) . ', ';
const mobileHideVideo = function(){
const video = document.querySelector( '.div-of-video-element' );
video.remove();
}
if (window.screen.width < 768) {
mobileHideVideo();
}
@bahia0019
bahia0019 / flip-image.js
Last active April 19, 2018 02:14
Flip Image with Greensock
/**
* Polaroid Flip
*
*/
const polaroidFlip = function () {
const flipSection = document.querySelectorAll('section');
for (var i = 0; i < flipSection.length; i++) {
@bahia0019
bahia0019 / flip-image.js
Created April 19, 2018 02:13
Flip Image with Greensock
/**
* Polaroid Flip
*
*/
// const polaroidFlip = function () {
// const flipSection = document.querySelectorAll('section');
@bahia0019
bahia0019 / acf-seo-image.php
Last active March 31, 2017 23:25
For ACF users, creates an easy to use function that wraps your image in HTML5 <figure> adds <figcaption>. Also adds Schema markup in JSON LD. Parameters are 1. ACF field name, 2. Size, 3. Figure CSS class, 4. Figcaption CSS class.
function fsc_figure( $image, $size, $imageclass, $captionclass ){
/**
* Let plugins pre-filter the image meta to be able to fix inconsistencies in the stored data.
*
* @param string $image The ACF field name (i.e. 'your_photo_name').
* @param string $size Thumbnail size (i.e. 'Thumbnail', 'Medium', 'Large')
* @param string $imageclass The Figure class you want to use (ex: 'my-figure')
* @param string $captionclass The Figcaption class you want to use (ex: 'caption-blue')
*/
<?php
add_filter('the_content', 'fyc_the_content');
function fyc_the_content( $content ) {
if (is_singular( 'clients' ) && in_the_loop()) {
ob_start(); ?>
<div class="fyc-top">