Skip to content

Instantly share code, notes, and snippets.

@setola
setola / merge_images.php
Created May 5, 2012 18:56
Slideshow: One big image for all
<?php
function merge_images($images, $config=null){
if(empty($images)) return 'No images';
$config = array_merge(
array(
'w' => '700',
'h' => '370',
'q' => '50',
'r' => false
@setola
setola / tilesloaded.js
Created May 8, 2012 22:18
Gmaps - cutted baloon
google.maps.event.addListener(map, 'tilesloaded', function() {
infowindow.open(map,marker);
});
@setola
setola / functions.php
Created May 21, 2012 23:19
A simple way to manage a slideshow with WordPress
<?php
add_theme_support('post-thumbnails');
add_image_size('slideshow-mini', 870, 500, true);
@setola
setola / portfolio-post.php
Created June 6, 2012 23:32
Trick to have the 'Portfolio' entry into the breadcrumbs
<?php
/**
* Trick to have the 'Portfolio' entry into the breadcrumbs
*/
global $portfolio_id;
$portfolio_id = 165;
add_filter('wp_seo_get_bc_ancestors', 'add_portfolio_taxonomy', 10, 1);
function add_portfolio_taxonomy($ancestors){
global $portfolio_id;
$ancestors[] = $portfolio_id;
@setola
setola / index.html
Created June 11, 2012 22:53
CSS gradient border
<style>
.inner,.wrapper:hover {
background: #e2017b;
background: -moz-linear-gradient(top, #e2017b 0%, #640037 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #e2017b), color-stop(100%, #640037) );
background: -webkit-linear-gradient(top, #e2017b 0%, #640037 100%);
background: -o-linear-gradient(top, #e2017b 0%, #640037 100%);
background: -ms-linear-gradient(top, #e2017b 0%, #640037 100%);
background: linear-gradient(top, #e2017b 0%, #640037 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e2017b', endColorstr='#640037', GradientType=0 );
@setola
setola / app.js
Created June 26, 2012 08:51
Font Size to fit container's witdh
jQuery(document).ready(function(){
jQuery('#container1 .auto-size').textAutoSize({
width: 249,
maxSize: 200,
minSize: 5,
//testEl: jQuery('#auto-size-test'),
mode: "ite-binary"
});
jQuery('#container2 .auto-size').textAutoSize({
maxSize: 100,
@setola
setola / portfolio.php
Created July 9, 2012 16:15
Portfolio image list
<?php
/**
* Manage the portfolio feature
* @author etessore
*
*/
class portfolio{
const url_field_name = 'url';
const customer_box_id = 'customer-box';
const client_custom_post_name = 'clients';
@setola
setola / app.js
Created July 25, 2012 15:22
jQuery Images Preload and Aspect Ratio Saver
jQuery(document).ready(function(){
jQuery('#slideshow').doSlideshow();
});
jQuery(window).resize(function(){
jQuery('#slideshow').imageResize();
});
jQuery.fn.doSlideshow = function() {
if (
@setola
setola / function.php
Created August 2, 2012 10:17
Wordpress - excerpt with wysiwyg editor
<?php
/**
* This class removes the default excerpt metabox
* and adds a new box with the wysiwyg editor capability
* @author etessore
*/
class TinyMceExcerptCustomization{
const textdomain = '';
const custom_exceprt_slug = '_custom-excerpt';
@setola
setola / functions.php
Last active September 25, 2020 18:29 — forked from johnmegahan/functions.php
Extended Walker class for use with the Twitter Bootstrap toolkit Dropdown n-levels menus in Wordpress.
<?php
/**
* Extended Walker class for use with the
* Twitter Bootstrap toolkit Dropdown menus in Wordpress.
* Edited to support n-levels submenu.
* @author johnmegahan https://gist.github.com/1597994, Emanuele 'Tex' Tessore https://gist.github.com/3765640
* @license CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
*/
class BootstrapNavMenuWalker extends Walker_Nav_Menu {