Skip to content

Instantly share code, notes, and snippets.

View pije76's full-sized avatar

panjianom pije76

  • Indonesia
  • 15:12 (UTC +07:00)
  • X @pije76
View GitHub Profile
@pije76
pije76 / archive-product.php
Created July 14, 2019 23:02 — forked from lukecav/archive-product.php
OceanWP - WooCommerce archive product template for FacetWP
<?php
/**
* The Template for displaying product archives, including the main shop page which is a post type archive
*
* This template can be overridden by copying it to yourtheme/woocommerce/archive-product.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you (the theme developer).
* will need to copy the new files to your theme to maintain compatibility. We try to do this.
* as little as possible, but it does happen. When this occurs the version of the template file will.
* be bumped and the readme will list any important changes.
<?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 = {