Skip to content

Instantly share code, notes, and snippets.

@jekey123
jekey123 / UM-Infinte-Scroll.html
Last active February 7, 2018 20:02
Ultimate Member Infinite Scroll Member Directory
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery-infinitescroll/2.1.0/jquery.infinitescroll.min.js" defer="defer"></script>
<script type="text/javascript">
(function() {
function waitDefer(method) {
if (window.jQuery && window.jQuery.fn.infinitescroll)
method();
else
setTimeout(function() { waitDefer(method) }, 50);
}
@jesseeproductions
jesseeproductions / tickets-plus-disable-tax.php
Created March 2, 2016 13:51
Event Tickets Plus - Disable Taxes for Ticket Products
/**
* Event Tickets Plus - Disable Taxes for Ticket Products
*/
add_action( 'wootickets_after_save_ticket', 'tribe_disable_taxes_ticket_product' );
function tribe_disable_taxes_ticket_product( $ticket_id ) {
update_post_meta( $ticket_id, '_tax_status', 'none' );
update_post_meta( $ticket_id, '_tax_class', 'zero-rate' );
}
@qholzweg
qholzweg / get_posts.php
Last active October 6, 2018 11:06
Wordpress get_posts with thumb
<?php
$args = array('post_type' => array('page'), 'order' => 'ASC', 'orderby' => 'date'/*
to sort by custom fields
, 'meta_query' => array(
array(
'key' => 'meta',
'value' => true,
)
)
*/
@webgurus
webgurus / acf_slider_bootstrap
Last active September 7, 2020 10:39
Root's bootstrap slider example with Advanced Custom Fields Gallery plugin.
<?php
/* SLIDER CUSTOM FIELD FOR HOMEPAGE */
$images = get_field('slider_photos');
$count=0;
$count1=0;
if($images) : ?>
<div id="slider">
<div id="carousel" class="carousel slide">
<!-- Indicators -->
@guifromrio
guifromrio / compress-pdf-with-gs.md
Created August 30, 2013 14:39
Compress PDF files with ghostscript

This can reduce files to ~15% of their size (2.3M to 345K, in one case) with no obvious degradation of quality.

ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

Other options for PDFSETTINGS:

  • /screen selects low-resolution output similar to the Acrobat Distiller "Screen Optimized" setting.
  • /ebook selects medium-resolution output similar to the Acrobat Distiller "eBook" setting.
  • /printer selects output similar to the Acrobat Distiller "Print Optimized" setting.
  • /prepress selects output similar to Acrobat Distiller "Prepress Optimized" setting.
@jo-snips
jo-snips / events-conditional-wrappers.php
Last active December 21, 2023 12:27
The Events Calendar: Basic Conditional Wrappers
<?php
/*-----------------------------------------------------------------------------------*/
/* Conditional Logic to Detect Various Event Related Views/Pages
/*-----------------------------------------------------------------------------------*/
if( tribe_is_month() && !is_tax() ) { // Month View Page
echo 'were on the month view page';
} elseif( tribe_is_month() && is_tax() ) { // Month View Category Page