Skip to content

Instantly share code, notes, and snippets.

View pije76's full-sized avatar

panjianom pije76

View GitHub Profile
@pije76
pije76 / gist:4774bafdb2a005508c1dd143ee594bc6
Created July 22, 2019 13:55 — forked from CoachBirgit/gist:f1b94ccb22dc8d653fa3
Ultimate Member Private Messages: dynamic message button by passing dynamic user ID
<?php echo do_shortcode('[ultimatemember_message_button user_id='.$user_id.']'); ?>
@pije76
pije76 / custom-hooks.php
Created July 18, 2019 13:28 — forked from djrmom/custom-hooks.php
facetwp uncheck parent checkbox
<?php
/** uncheck the parent when checking a child checkbox **/
add_action( 'wp_footer', function() { ?>
<script>
(function($) {
$(document).on('click', '.facetwp-depth .facetwp-checkbox', function() {
if ( $( this ).hasClass( "checked" ) ) {
$(this).parent().prev().removeClass('checked');
FWP.autoload();
<?php
/* Template Name: games dynamic */
global $avia_config;
/*
* get_header is a basic wordpress function, used to retrieve the header.php file in your theme directory.
*/
get_header();
if( get_post_meta(get_the_ID(), 'header', true) != 'no') echo avia_title();
?>
<div class='container_wrap container_wrap_first main_color shop_columns_3 <?php avia_layout_class( 'main' ); ?>'>
@pije76
pije76 / custom-hooks.php
Created July 15, 2019 04:48 — forked from djrmom/custom-hooks.php
facetwp fade out/in with pre-load
<?php
/**
** update of https://facetwp.com/fade-template-content-during-refresh/ to only fade in on pre-load
**/
add_action( 'wp_footer', function() { ?>
<style>
.facetwp-template {
opacity: 0;
}
<script>
(function($) {
$(document).on('facetwp-refresh', function() {
location.reload()
});
})(jQuery);
</script>
@pije76
pije76 / test.js
Created July 15, 2019 04:47 — forked from mgibbs189/test.js
Code used for facetWP reload page loop
<script>
(function($) {
$(document).on('facetwp-refresh', function() {
if (FWP.loaded) { // after the initial pageload
FWP.parse_facets(); // load the values
FWP.set_hash(); // set the new URL
location.reload();
return false;
}
});
<?php
/* Template Name: games dynamic */
global $avia_config;
/*
* get_header is a basic wordpress function, used to retrieve the header.php file in your theme directory.
*/
get_header();
if( get_post_meta(get_the_ID(), 'header', true) != 'no') echo avia_title();
$loading_gif_url = home_url().'/wp-content/uploads/2016/08/loading.gif';
@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',