Skip to content

Instantly share code, notes, and snippets.

View dariodev's full-sized avatar

Dario Devcic dariodev

  • Zagreb
View GitHub Profile
@dariodev
dariodev / high-dpi-media.css
Created January 15, 2016 16:53 — forked from marcedwards/high-dpi-media.css
A CSS media query that captures almost all high DPI aware devices.
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */
@dariodev
dariodev / register-post-type.php
Created October 6, 2015 00:56 — forked from justintadlock/register-post-type.php
Help file when registering post types.
<?php
/* Register custom post types on the 'init' hook. */
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 0.1.0
* @access public
@dariodev
dariodev / wc-quantity-increment.js
Last active September 21, 2015 12:45 — forked from webaware/gist:ebdb30dc33714f04e32b
Adds Quantity Increment buttons that were depreciated as of WooCommerce 2.3
jQuery(function($) {
// Quantity buttons
$( 'div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)' ).addClass( 'buttons_added' ).append( '<input type="button" value="+" class="plus" />' ).prepend( '<input type="button" value="-" class="minus" />' );
$( document ).on( 'click', '.plus, .minus', function() {
// Get values
var $qty = $( this ).closest( '.quantity' ).find( '.qty' ),
<?php
/**
* Kirki Advanced Customizer
*
* This is a sample configuration file to demonstrate all fields & capabilities.
*
* CAUTION:
* USE THIS WITH THE DEVELOP BRANCH ON THE GITHUB REPOSITORY:
* https://github.com/aristath/kirki/tree/develop
*
For more details, see http://code.garyjones.co.uk/install-wordpress-ssh/
wget http://wordpress.org/latest.tar.gz
tar zxf latest.tar.gz
cd wordpress
cp -rpf * ../
cd ../
rm -rf wordpress/
rm -f latest.tar.gz
<?php
/**
* Plugin Name: WooCommerce - List Products by Tags
* Plugin URI: http://www.remicorson.com/list-woocommerce-products-by-tags/
* Description: List WooCommerce products by tags using a shortcode, ex: [woo_products_by_tags tags="shoes,socks"]
* Version: 1.0
* Author: Remi Corson
* Author URI: http://remicorson.com
* Requires at least: 3.5
* Tested up to: 3.5
upstream phpfpm {
server unix:/var/run/php5-fpm.sock;
}
upstream hhvm {
server unix:/var/run/hhvm/hhvm.sock;
}
# SSL
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
add_filter( 'tgmsp_pre_load_slider', 'tgm_soliloquy_transform_to_gallery', 10, 5 );
/**
* Circumvents the slider output and allows access to raw format.
*
* @param bool $bool Boolen if the filter should be run. Default is false.
* @param int $id The slider ID being filtered.
* @param array $images Array of images in the slider.
* @param array $data Array of meta for the slider.
* @param int $count The current number of the slider on page (if there is more than one on the page).
* @return bool|string False if you want to keep a slider, HTML output for something else.
add_filter( 'tgmsp_pre_load_slider', 'tgm_soliloquy_transform_to_gallery', 10, 5 );
/**
* Circumvents the slider output and allows access to raw format.
*
* @param bool $bool Boolen if the filter should be run. Default is false.
* @param int $id The slider ID being filtered.
* @param array $images Array of images in the slider.
* @param array $data Array of meta for the slider.
* @param int $count The current number of the slider on page (if there is more than one on the page).
* @return bool|string False if you want to keep a slider, HTML output for something else.
// create fake page called "chat-room"
// modify function and variable names with "ABCD" to whatever you like
// modify variable $fakepage_ABCD_url to the fake URL you require
add_filter('the_posts','fakepage_ABCD_detect',-10);
function fakepage_ABCD_detect($posts){
global $wp;
global $wp_query;
global $fakepage_ABCD_detect; // used to stop double loading