Skip to content

Instantly share code, notes, and snippets.

View pije76's full-sized avatar

panjianom pije76

View GitHub Profile
<?php
remove_action( 'genesis_loop', 'genesis_do_loop');
add_action( 'genesis_loop', 'lofts_floor_plan_loop' );
//* Add filtering sidebar
add_action( 'genesis_before_content', 'floorplan_filters' );
function floorplan_filters() {
@pije76
pije76 / custom-loop.php
Created July 14, 2019 20:03 — forked from mgibbs189/custom-loop.php
Multiple Loops for FacetWP
<?php
$args = array(
'post_type' => 'location',
'posts_per_page' => -1,
'order' => 'ASC',
'orderby' => 'title',
'facetwp' => true,
'tax_query' => array(
array(
'taxonomy' => 'advertiser-level',
@pije76
pije76 / gist:9a98eb0f0c209cee7988dd707e29de5b
Created July 14, 2019 20:03
Multiple Loops for FacetWP
<?php $args = array(
'post_type' => 'location',
'posts_per_page' => -1,
'order' => 'ASC',
'orderby' => 'title',
'facetwp' => true,
'tax_query' => array(
array(
'taxonomy' => 'advertiser-level',
'field' => 'slug',
@pije76
pije76 / index.php
Created July 10, 2019 21:20 — forked from null-dev/index.php
1fichier.com direct link generator (PHP)
<?php
if(!isset($_GET['a'])) {
die('<form action="" method="get"><input type="text" name="a"/><input type="submit"/></form>');
}
$url = "https://1fichier.com/?" . urlencode($_GET['a']) . "?auth=1&inline";
stream_context_set_default(array(
'http' => array(
'method' => 'GET',
'header' => 'Authorization: Basic ' . '[BASE64 encoded login credentials. Format: "user:pass" (without quotes)]'
@pije76
pije76 / edd_download_slug.php
Created July 9, 2019 00:22 — forked from JiveDig/edd_download_slug.php
Change Easy Digital Downloads (EDD) 'download' slug to something else. Refresh permalinks after changing this.
// Change 'download' slug to something else
define('EDD_SLUG', 'books');
@pije76
pije76 / functions.php
Created July 8, 2019 13:18 — forked from ChromeOrange/functions.php
Woocommerce Sold Individually - with individual as default
/*
* Sell Products Individually in WooCommerce
*/
add_filter( 'woocommerce_is_sold_individually', 'cj_woocommerce_is_sold_individually', 10, 2 );
function cj_woocommerce_is_sold_individually( $value, $product ) {
$isi = get_post_meta( $product->id, '_custom_sell_individually', TRUE );
// Block Non-Admins from Accessing Dashboard
function blockusers_init() {
if ( is_admin() && ! current_user_can( 'administrator' ) && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
wp_redirect( home_url() );
exit;
}
}
add_action( 'init', 'blockusers_init' );
<script>
// This example displays an address form, using the autocomplete feature
// of the Google Places API to help users fill in the information.
// This example requires the Places library. Include the libraries=places
// parameter when you first load the API. For example:
// <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places">
var placeSearch, autocomplete;
var componentForm = {
<script>
// This example displays an address form, using the autocomplete feature
// of the Google Places API to help users fill in the information.
// This example requires the Places library. Include the libraries=places
// parameter when you first load the API. For example:
// <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places">
var placeSearch, autocomplete;
var componentForm = {
@pije76
pije76 / GFORM: Change Currency
Created June 30, 2019 21:03 — forked from kenmasters/GFORM: Change Currency
Gravity Forms PayPal Standard Add-On
/**
* Change payment currency base from another field, when specific form is submitted.
*/
add_action( 'gform_pre_submission_2', 'change_currency_' );
function change_currency_( $form ) {
add_filter( 'gform_currency', function() { return rgpost('input_4'); } );
}