Skip to content

Instantly share code, notes, and snippets.

@rexrony
rexrony / change-admin-url.php
Created April 22, 2021 11:33 — forked from hakre/change-admin-url.php
Change Admin URL
<?php
/**
* Change Admin URL
*
* Copyright (C) 2010 hakre <http://hakre.wordpress.com/>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
<?php
/**
* Get all type posts
*
* @return void
* @author alispx/dompl
**/
function alispx_get_type_posts_data($post_type = 'post')
{
@rexrony
rexrony / webstoemp-gulpfile.js
Created February 7, 2019 10:54 — forked from jeromecoupe/webstoemp-gulpfile.js
Gulp 4 sample gulpfile.js. For a full explanation, have a look at https://www.webstoemp.com/blog/switching-to-gulp4/
"use strict";
// Load plugins
const autoprefixer = require("autoprefixer");
const browsersync = require("browser-sync").create();
const cp = require("child_process");
const cssnano = require("cssnano");
const del = require("del");
const eslint = require("gulp-eslint");
const gulp = require("gulp");
@rexrony
rexrony / wpb-wiz-functions.php
Created October 26, 2018 18:01 — forked from wpbean/wpb-wiz-functions.php
Add this code for disable WooCommerce Gallery Slider and FlexSlider script
<?php
/**
* Remove WooCommerce flexslider script & product gallery slider
*/
function wpb_wiz_after_theme_setup(){
remove_theme_support( 'wc-product-gallery-slider' );
}
add_action( 'after_setup_theme', 'wpb_wiz_after_theme_setup', 99 );
@rexrony
rexrony / woocommerce-remove-virtual-billing-fields.php
Created May 29, 2017 13:46 — forked from BFTrick/woocommerce-remove-virtual-billing-fields.php
Remove the billing address fields for free virtual orders in WooCommerce
<?php
/**
* Plugin Name: WooCommerce Remove Billing Fields for Free Virtual Products
* Plugin URI: https://gist.github.com/BFTrick/7873168
* Description: Remove the billing address fields for free virtual orders
* Author: Patrick Rauland
* Author URI: http://patrickrauland.com/
* Version: 2.0
*
* This program is free software: you can redistribute it and/or modify
@rexrony
rexrony / add-to-cart.php
Created March 2, 2017 13:03 — forked from webaware/add-to-cart.php
WooCommerce purchase page add-to-cart with quantity and AJAX, by customising the add-to-cart template in the WooCommerce loop. See blog post for details: http://snippets.webaware.com.au/snippets/woocommerce-add-to-cart-with-quantity-and-ajax/
<?php
/**
* Loop Add to Cart -- with quantity and AJAX
* requires associated JavaScript file qty-add-to-cart.js
*
* @link http://snippets.webaware.com.au/snippets/woocommerce-add-to-cart-with-quantity-and-ajax/
* @link https://gist.github.com/mikejolley/2793710/
*/
// add this file to folder "woocommerce/loop" inside theme
@rexrony
rexrony / ajaxify-cart.php
Created January 28, 2017 14:22 — forked from DanielSantoro/ajaxify-cart.php
AJAX Update Cart thats added to Template File Manually (
// Ensure cart contents update when products are added to the cart via AJAX (place the following in functions.php).
// Used in conjunction with https://gist.github.com/DanielSantoro/1d0dc206e242239624eb71b2636ab148
add_filter('add_to_cart_fragments', 'woocommerce_header_add_to_cart_fragment');
function woocommerce_header_add_to_cart_fragment( $fragments ) {
global $woocommerce;
ob_start();
?>
@rexrony
rexrony / codesnippet.php
Created January 28, 2017 14:22 — forked from DanielSantoro/codesnippet.php
Show Number of items in Cart and Subtotal (insert into template)
<a class="cart-customlocation" href="<?php echo wc_get_cart_url(); ?>" title="<?php _e( 'View your shopping cart' ); ?>"><?php echo sprintf ( _n( '%d item', '%d items', WC()->cart->get_cart_contents_count() ), WC()->cart->get_cart_contents_count() ); ?> - <?php echo WC()->cart->get_cart_total(); ?></a>
@rexrony
rexrony / Custom slick dots.js
Created January 11, 2017 11:28
Custom Dots for slick.js
/**
* Slick
*/
;(function($) {
$('.slick').slick({
infinite: false,
dots: true,
customPaging: function(slider, i) {
@rexrony
rexrony / valueToPlaceholder.js
Created July 27, 2016 07:18 — forked from charleslouis/valueToPlaceholder.js
#value #placeholder #attribute #html5 #form #input #inputfiled #jquery
function valueToPlaceHolder(divId){
// this function creates a placeholder based on the attribute 'value' of this same input text field
//once done, it removes the 'value' attribute
// it is useful for cforms II plugin cos placholder are not available, while default value attr are
// THIS :
// <input xxx value="Prénom - First name" xxx>
// would return :
// <input xxx placeholder="Prénom - First name" xxx>
// see http://stackoverflow.com/questions/11432144/change-value-to-placeholder-input-field
if( document.getElementById(divId) ){