Skip to content

Instantly share code, notes, and snippets.

@lonchbox
lonchbox / gist:999616a3586f2817af71
Created Mar 10, 2016
WPML custom language switcher
View gist:999616a3586f2817af71
<?php
/*
* WPML language switcher customizations: htp://wpml.org
*/
function custom_wpml_lang_switcher() {
if (function_exists('icl_get_languages')){
// remove WPML default css
define('ICL_DONT_LOAD_LANGUAGE_SELECTOR_CSS', true);
// Custom language layout selector ?>
@lonchbox
lonchbox / gist:fb152c46f4ed5c1a410f
Created Mar 10, 2016
Display Custom Taxonomy image field with Pods.io
View gist:fb152c46f4ed5c1a410f
<?php
$terms = get_terms( 'TAXONOMY' );
if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){
foreach ( $terms as $term ) {
echo '<div class="item">';
$icon = pods_field( 'TAXONOMY', $term->term_id, 'FIELD', true );
$icon_url = $icon['guid'];
$icon_thumb = pods_image_url ( $icon_url, 'thumbnail', 0, false ) ;
$term_link = get_term_link($term);
echo '<a href="'.$term_link.'">';
@lonchbox
lonchbox / LongSocial-Contact.txt
Last active Nov 23, 2015
LongSocial WordPress Theme Contact page template code
View LongSocial-Contact.txt
<!-- EXAMPLE 1 -->
<div class="row">
<div class="col-md-6">[contact-form-7 id="88" title="Contact form 1"]</div>
<div class="col-md-6">
<address>
<strong>33 Themes HQ</strong>
Carrer d'En Bosc, 8
@lonchbox
lonchbox / grunfile.js
Last active Nov 4, 2015
Example to use grunt-wp-i18n makepot, update .po from .pot and grunt-po2mo
View grunfile.js
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// LESS Compilation
less: {
development: {
options: {
paths: ["src/css"]
@lonchbox
lonchbox / app.js
Created Jun 20, 2014
App.js to load Foundation Zurb javascript. Make WordPress custom menu compatible with Foundation Zurb top-bar classes
View app.js
jQuery(document).ready(function($) {
/* WORDPRESS NAV-BAR SUPPORT ------------- */
/* Adds support for the top-bar with flyouts in WordPress */
$('.top-bar-section li').has('ul').addClass("has-dropdown");
$('.top-bar-section li.has-dropdown ul').addClass("dropdown");
/*loads foundation*/
jQuery(document).foundation();
@lonchbox
lonchbox / index.html
Created Sep 11, 2012
Text effect animations
View index.html
<html>
<body>
<p>fly in, fly out</p>
</body>
</html>
You can’t perform that action at this time.