Skip to content

Instantly share code, notes, and snippets.

View diegochavez's full-sized avatar
🎯
Focusing

Diego Chavez diegochavez

🎯
Focusing
View GitHub Profile
add_filter('json_api_encode', 'json_api_encode_acf');
function json_api_encode_acf($response)
{
if (isset($response['posts'])) {
foreach ($response['posts'] as $post) {
json_api_add_acf($post); // Add specs to each post
}
}
@diegochavez
diegochavez / config.rb
Created November 13, 2013 18:54
Compass regular configuration file config.rb I use this on sublimetext with livereload wich export the file in the same directory of the compass file.
http_path = "/"
css_dir = "."
sass_dir = "."
images_dir = "img"
javascripts_dir = "js"
output_style = :compact
relative_assets=true
line_comments = false
@diegochavez
diegochavez / gist:6731825
Created September 27, 2013 17:10
My custom wp_bootstrap_navwalker based on https://github.com/twittem/wp-bootstrap-navwalker
<?php
/**
* Class Name: wp_bootstrap_navwalker
* GitHub URI: https://github.com/twittem/wp-bootstrap-navwalker
* Description: A custom WordPress nav walker class to implement the Twitter Bootstrap 2.3.2 navigation style in a custom theme using the WordPress built in menu manager.
* Version: 2.0.1
* Author: Edward McIntyre - @twittem
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
@diegochavez
diegochavez / custom-drop-down.php
Created August 28, 2013 05:00
Wordpress: Useful code to modify the TinyMCE drop-down menu == reference: http://justintadlock.com/archives/2011/05/02/dealing-with-shortcode-madness#comment-335205
// Your should include this in to your functions theme
add_filter('mce_buttons_2', 'wpse3882_mce_buttons_2');
function wpse3882_mce_buttons_2($buttons)
{
array_unshift($buttons, 'styleselect');
return $buttons;
}
add_filter('tiny_mce_before_init', 'wpse3882_tiny_mce_before_init');
function wpse3882_tiny_mce_before_init($settings)
@diegochavez
diegochavez / placeholder.js
Last active December 18, 2015 05:29 — forked from manfromanotherland/gist:2228169
Useful jQuery code to fix the place holder support
// Released under MIT license: http://www.opensource.org/licenses/mit-license.php
$('[placeholder]').focus(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
input.removeClass('placeholder');
}
}).blur(function() {
var input = $(this);
if (input.val() == '' || input.val() == input.attr('placeholder')) {