Skip to content

Instantly share code, notes, and snippets.

@bUxEE
bUxEE / HTaccess_home_redirect.php
Last active March 24, 2017 11:18
HTaccess mobile redirect (homepage only)
# BEGIN Mobile redirect
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} (android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge\ |maemo|midp|mmp|mobile.+firefox|netfront|opera\ m(ob|in)i|palm(\ os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows\ ce|xda|xiino [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^(1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a\ wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r\ |s\ )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1\ u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp(\ i|ip)|hs\-c|ht(c(\-|\ |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i2
@bUxEE
bUxEE / image_select_wp.php
Created November 18, 2016 23:48
add image select to text input field
// IMAGE SELECT
jQuery(document).ready(function($) {
if ($('.wpt_set_custom_images').length > 0) {
if ( typeof wp !== 'undefined' && wp.media && wp.media.editor) {
$(document).on('click', '.wpt_set_custom_images', function(e) {
e.preventDefault();
var button = $(this);
var id = button.prev();
wp.media.editor.send.attachment = function(props, attachment) {
id.val(attachment.url);
@bUxEE
bUxEE / add_image_size_wp.php
Created November 22, 2016 23:04
Add images size Wordpress
//////////////////////////////////////////////////////////////
///////// ADD CUSTOM IMAGE SIZES TO WP EDITOR
//////////////////////////////////////////////////////////////
add_image_size( 'icon100', '100', '100', false );
function my_editor_image_sizes( $sizes ) {
$sizes = array_merge( $sizes, array(
'icon100' => __( 'icon 100px' )
));
return $sizes;
@bUxEE
bUxEE / smooth_scroll.js
Last active September 5, 2018 20:42
Smooth scroll to ID from link or url
////////////////////////////////////////////////////////////////////////////////
// SMOOTH SCROLL TO ID
////////////////////////////////////////////////////////////////////////////////
var scrollIt = function(divID, speed) {
if($(divID).length) {
var elemTop = $(divID).offset().top;
$('html, body').animate({
scrollTop: elemTop
}, 800).promise().then(function() {
$(document).trigger('jquery_scrolling', {newPos: elemTop});
@bUxEE
bUxEE / boot_anim_hamb.css
Created February 28, 2017 09:16
bootstrap animated hamburger
/* HAMBURGER */
.navbar-toggle .icon-bar {
-webkit-transition: opacity, -webkit-transform;
transition: opacity, -webkit-transform;
transition: opacity, transform;
transition: opacity, transform, -webkit-transform;
-webkit-transition-duration: 200ms;
transition-duration: 200ms;
-webkit-transition-timing-function: cubic-bezier(0.7, 0, 0, 0.7);
transition-timing-function: cubic-bezier(0.7, 0, 0, 0.7);
@bUxEE
bUxEE / woo-snipp.php
Last active December 11, 2022 08:07
woocoommerce snippets
<?php
//////////////////////////////////////////////////////////////
// WOO COMMERCE SNIPPETS
//////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
// PAYMENT TYPE IN MAIL
///////////////////////////////////////////////////////////
add_action( 'woocommerce_email_after_order_table', 'add_payment_method_to_admin_new_order', 15, 2 );
@bUxEE
bUxEE / footer-sticky.js
Last active March 24, 2017 11:11
Stick footer bottom
@bUxEE
bUxEE / gf_bs_check.css
Created March 21, 2017 09:16
Gravity forms fontawesome checkbox css
/* checkboxes */
.checkboxer>.gfield_label {
display: inline-block !important;
padding-left: 15px !important;
width: calc(100% - 30px) !important;
float: right;
}
.gfield_checkbox, .gfield_checkbox li, .ginput_container_checkbox {
width: auto !important;
@bUxEE
bUxEE / gf_css.css
Created March 21, 2017 09:19
Gravity forms css styling
/* GRAVITY FORMS */
select:focus, input[type="file"]:focus, input[type="radio"]:focus {
outline: none !important;
}
.gform_wrapper .gform_body {
width:100%!important;
}
@bUxEE
bUxEE / boot-hamb-2.css
Created March 24, 2017 11:07
bootstrap hamburger animation
/* HAMBURGER ANIMATION 2
created by bux www.woptima.com */
.navbar-toggle{
-webkit-transition: transform;
transition: transform;
-webkit-transition-duration: 300ms;
transition-duration: 300ms;
-webkit-transition-timing-function: cubic-bezier(0.7, 0, 0, 0.7);
transition-timing-function: cubic-bezier(0.7, 0, 0, 0.7);