Skip to content

Instantly share code, notes, and snippets.

View digisavvy's full-sized avatar

Alex Vasquez digisavvy

View GitHub Profile
@digisavvy
digisavvy / gist:9363261
Created March 5, 2014 08:23
Soliloquy Dynamic Slider. Retriever the Current Post ID, exclude an ACF Image ID from Slider
function add_image_to_content() {
global $post;
$imageArray = get_field('project_cover_image'); // Array returned by Advanced Custom Fields
$imageID = $imageArray['id']; // Grab, from the array, the 'alt'
// echo "$imageID";
$dg_post_id = $post->ID;
if ( function_exists( 'soliloquy_dynamic' ) ) soliloquy_dynamic( array( 'id' => "$dg_post_id", 'exclude' => "$imageID" ) );
<?php
add_filter( 'soliloquy_output_slide', 'tgm_soliloquy_custom_html', 10, 4 );
function tgm_soliloquy_custom_html( $html, $id, $image, $data ) {
// If the ID doesn't match the one we want to modify, return the default HTML output. Change 324 to your slider ID.
$slider_id = $data['id'];
ob_start(); ?>
<span class="social-m">
<?php $summary = get_field('short_description');?>
@digisavvy
digisavvy / gist:b2862b0c44b62807b72a
Created September 19, 2014 07:19
My Browser Sync config
// Browser Sync
gulp.task('browser-sync', function() {
browserSync.init({
files: ["./**/*.php", "./**./*.html"],
proxy: "my-project.dev"
});
});
@digisavvy
digisavvy / if_user_caps
Created October 7, 2014 23:52
If user has caps
if ( current_user_can('moderate_comments') ) {
echo 'The current user can moderate comments';
} else {
echo 'Well, not everyone has nice hair like Alex!'
}
@digisavvy
digisavvy / composer.json
Last active August 29, 2015 14:07
composer.json
{
"name": "DigiSavvy Project Boilerplate",
"description": "Plugins and Theme for Use with DigiSavvy Projects",
"repositories":[
{
"type":"composer",
"url":"http://wpackagist.org"
},
{
"type": "package",
@digisavvy
digisavvy / check-title-tag-support
Created December 26, 2014 22:23
Checking for 'title-tag' support
// Adding Theme title tag support
function digistarter_title_tag_support() {
if ( current_theme_supports( 'title-tag' ) ) {
add_theme_support('title-tag');
} else { ?>
<title><?php wp_title( '|', true, 'right' ); ?></title>
<?php }
}
add_action( 'tha_head_bottom', 'digistarter_title_tag_support');
@digisavvy
digisavvy / gist:20792638abf81930187f
Created March 19, 2015 05:38
Jetpack carousel fun
// Image Markup
<dl class="gallery-item">
<dt class="">
<a href="//localhost:3000/shows/uncle-vanya/deathtostock_neighbors5/">
<img width="1024" height="683" src="//localhost:3000/wp-content/uploads/2015/03/DeathtoStock_Neighbors5-1024x683.jpg" class="attachment-large" alt="DeathtoStock_Neighbors5" data-attachment-id="3708" data-orig-file="//localhost:3000/wp-content/uploads/2015/03/DeathtoStock_Neighbors5.jpg" data-orig-size="4927,3285" data-comments-opened="0" data-image-meta="{&quot;aperture&quot;:&quot;1.6&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;Canon EOS 5D Mark III&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1426070992&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;50&quot;,&quot;iso&quot;:&quot;200&quot;,&quot;shutter_speed&quot;:&quot;0.01&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="DeathtoStock_Neighbors5" data-image-description="" data-medium-file="//localhos
@digisavvy
digisavvy / 0_reuse_code.js
Last active August 29, 2015 14:18
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@digisavvy
digisavvy / javascript_resources.md
Last active August 29, 2015 14:18 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@digisavvy
digisavvy / css_resources.md
Last active August 29, 2015 14:18 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides