Skip to content

Instantly share code, notes, and snippets.

View siamkreative's full-sized avatar

Julien Vernet siamkreative

View GitHub Profile
@siamkreative
siamkreative / bs-cf7.less
Last active August 29, 2015 14:08
Contact Form 7 & Bootstrap 3
/*
==========================================================================
Import Bootstrap Stuff
==========================================================================
*/
/* Core variables and mixins */
@import "less/variables.less";
@import "less/mixins/vendor-prefixes.less";
@import "less/mixins/alerts.less";
@siamkreative
siamkreative / cf7-form-no-label.html
Created November 3, 2014 08:08
Contact Form 7 Form without Labels
<div class="row">
<div class="col-md-6 form-group"><label class="sr-only">Full Name</label>[text* your-name class:form-control placeholder "Full Name"]</div>
<div class="col-md-6 form-group"><label class="sr-only">Email Address</label>[email* your-email class:form-control placeholder "Email Address"]</div>
</div>
<div class="form-group"><label class="sr-only">Subject</label>[text your-subject class:form-control placeholder "Subject"]</div>
<div class="form-group"><label class="sr-only">Message</label>[textarea your-message x5 class:form-control placeholder "message"]</div>
<div class="form-group">[submit class:btn class:btn-primary "Send"]</div>
@siamkreative
siamkreative / edd-ajax-custom.js
Created January 27, 2015 02:57
EDD AJAX: Using Easy Digital Downloads with AJAX (on the Front-End)
$('.buy-now').on('click', function (event) {
event.preventDefault();
var el = $(this),
item_download = el.attr('data-id'),
current_page = el.attr('data-current'),
item_price_id = false;
$.ajax({
type: 'POST',
@siamkreative
siamkreative / wpadminbar.js
Created February 17, 2015 07:44
Update Javascript Variable if WordPress Admin Bar is enabled
jQuery(document).ready(function ($) {
// The long version
var scrollOffset;
if ($('body').hasClass('admin-bar')) {
scrollOffset = 64;
} else {
scrollOffset = 32;
}
@siamkreative
siamkreative / eurozone.json
Created April 2, 2015 08:32
Eurozone JSON data from http://en.wikipedia.org/wiki/Eurozone (crawled on 2015-04-02)
[
{
"State": "Austria",
"Adopted": "1999-01-01[15]",
"PreviousCurrency": "Schilling",
"ISO": "AT"
},
{
"State": "Belgium",
"Adopted": "1999-01-01[15]",
@siamkreative
siamkreative / google-analytics-redirect.html
Created September 29, 2015 10:05
Tracking QR Codes with Google Analytics
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Interstitial Tracking Page</title>
<!-- Google Analytics | https://developers.google.com/analytics/devguides/collection/analyticsjs/advanced?hl=en -->
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
.gmap {
position: relative;
padding-bottom: 50%; // This is the aspect ratio
height: 0;
overflow: hidden;
}
.gmap > .wp_gmaps_canvas {
position: absolute;
top: 0;
left: 0;
jQuery(document).ready(function ($) {
var select = $('#taed-font-family');
var fontTypes = [];
var fontsOptions = '';
$.getJSON('/websafefonts.json', function (json) {
$.each(json.fonts, function (type, fontArr) {
fontTypes.push(type);
$.each(fontArr, function (index, font) {
fontsOptions += '<option value="' + font + '" class="fonttype" data-type="' + type + '">' + font + '</option>'
@siamkreative
siamkreative / as_custom_fields.php
Created May 27, 2016 07:39
Awesome Support - Register a custom field after the plugin is safely loaded
<?php
/**
* Register all custom fields after the plugin is safely loaded.
*/
add_action( 'plugins_loaded', 'wpas_user_custom_fields' );
function wpas_user_custom_fields() {
if ( function_exists( 'wpas_add_custom_field' ) ) {
wpas_add_custom_taxonomy( 'my_custom_services', array( 'title' => 'My Custom Services', 'label' => 'Service', 'label_plural' => 'Services' ) );
}
}
@siamkreative
siamkreative / wpbp-grid.php
Created June 15, 2016 02:47
Behance Portfolio for WordPress - 4 Columns Layout for Boostrap Themes http://codecanyon.net/item/behance-portfolio-for-wordpress/7123148?ref=themeavenue
<div id="<?php echo $project->get_field( 'id' ); ?>" class="col-sm-3 wpbp-mix <?php echo $fields; ?>" data-pubdate="<?php echo $project->get_field( 'published_on' ); ?>">
<figure>
<a class="wpbp-project-imglink ta-modal-launch" href="#wpbp-project-<?php echo $project->get_field( 'id' ); ?>"><img src="<?php echo $project_cover; ?>" alt="<?php echo $project->get_field( 'name' ); ?>" class="img-responsive"></a>
<figcaption>
<div class="wpbp-valign">
<div class="wpbp-valign-inner">
<div class="wpbp-project-title"><?php echo $project->get_field( 'name' ); ?></div>
<div class="wpbp-project-fields"><?php echo implode( ', ', $project->get_fields() ); ?></div>
<a class="wpbp-project-more ta-modal-launch" href="#wpbp-project-<?php echo $project->get_field( 'id' ); ?>"><?php echo $button_label; ?></a>
</div>