Skip to content

Instantly share code, notes, and snippets.

View dariodev's full-sized avatar

Dario Devcic dariodev

  • Zagreb
View GitHub Profile
<?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
<?php
add_filter("the_content", "the_content_filter");
function the_content_filter($content) {
// array of custom shortcodes requiring the fix
$block = join("|",array("col","shortcode2","shortcode3"));
// opening tag
<?php
add_filter("the_content", "the_content_filter");
function the_content_filter($content) {
// array of custom shortcodes requiring the fix
$block = join("|",array("col","shortcode2","shortcode3"));
// opening tag
$(document).ready(function() {
$.waypoints.settings.scrollThrottle = 30;
$('#main').waypoint(function(event, direction){
/* Just as we have a sticky class applied when we hit the top waypoint,
we'll have a different class applied when we bottom out */
if (direction === 'down') {
$(this).removeClass('sticky').addClass('bottomed');
}
else {
$(this).removeClass('bottomed').addClass('sticky');