Skip to content

Instantly share code, notes, and snippets.

View marcinkrzeminski's full-sized avatar
🍌
👈🏼 my fuel 🤪

Marcin Krzemiński marcinkrzeminski

🍌
👈🏼 my fuel 🤪
View GitHub Profile
@marcinkrzeminski
marcinkrzeminski / acf-get-field-key.php
Created November 26, 2018 08:36 — forked from mcguffin/acf-get-field-key.php
WordPress Advanced Custom Fields get field key from field name
<?php
/**
* Get field key for field name.
* Will return first matched acf field key for a give field name.
*
* ACF somehow requires a field key, where a sane developer would prefer a human readable field name.
* http://www.advancedcustomfields.com/resources/update_field/#field_key-vs%20field_name
*
* This function will return the field_key of a certain field.
@marcinkrzeminski
marcinkrzeminski / no-container-and-parent.php
Created May 1, 2018 09:56
wp_nav_menu() no wrapper and parent <ul>, just the <li>
<?php
wp_nav_menu(array(
'theme_location' => 'primary_navigation',
'container' => '',
'items_wrap' => '%3$s',
))
@marcinkrzeminski
marcinkrzeminski / gulpfile.js
Last active October 22, 2023 13:36
Simple WordPress with Gulp
var gulp = require('gulp');
var browserSync = require('browser-sync');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var autoprefixer = require('gulp-autoprefixer');
var cleanCSS = require('gulp-clean-css');
var imagemin = require('gulp-imagemin');
var changed = require('gulp-changed');
var del = require('del');
var sequence = require('run-sequence');
@marcinkrzeminski
marcinkrzeminski / index.html
Created January 22, 2015 12:26
jQuery Mask IBAN
<input type="text" name="field-name" class="field-name" />
@marcinkrzeminski
marcinkrzeminski / gist:3884631
Created October 13, 2012 13:30 — forked from padolsey/gist:527683
JS: IE Detect
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}