Skip to content

Instantly share code, notes, and snippets.

View jlengstorf's full-sized avatar
💭
partyin

Jason Lengstorf jlengstorf

💭
partyin
View GitHub Profile
@jlengstorf
jlengstorf / README.md
Last active August 29, 2015 13:57
A simple mix-in to handle `@font-face` loading.

LESS Mix-In for Web Fonts

This mix-in is a shortcut for the cumbersome @font-face declaration.

It assumes that all font files are stored in the same directory and share the same file name (e.g. font-name.eot, font-name.woff, etc.).

Usage

@jlengstorf
jlengstorf / gruntfile.js
Last active August 29, 2015 14:00
Standard Grunt setup for a WordPress theme. Place in the theme's root.
module.exports = function(grunt) {
grunt.registerTask('watch', [ 'watch' ]);
grunt.initConfig({
uglify: {
options: {
mangle: true,
compress: true,
preserveComments: 'some'
nav {
&.navbar {
.navbar-header {
.navbar-toggle {
}
.navbar-brand {
}
}

Modal Windows for WordPress

A relatively simple way to add responsive modal windows to a WordPress theme.

To install, add the JS/LESS to your child theme and drop the template in the root of your theme.

In the WordPress dashboard, create a new page and set it to the "Modal (Pop-Over)" template. Add any content here — HTML is allowed.

In the modal JS, set modal_window_uri to the new page's path.

@jlengstorf
jlengstorf / deploy.php
Created May 16, 2014 17:31
An extremely basic Git deployment script.
<?php
// Removes any local changes to avoid errors with the pull
shell_exec("git reset --hard HEAD >> ../logs/deploy.log 2>&1");
// Pulls the latest changes from the develop branch
shell_exec("git pull -v origin develop >> ../logs/deploy.log 2>&1");
shell_exec("git submodule init >> ../logs/deploy.log 2>&1");
shell_exec("git submodule update >> ../logs/deploy.log 2>&1");
$ find . -type f -print | grep '.gitignore' | xargs grep -i 'yoast' # No results
$ git add wp-content/plugins/wordpress-seo/admin/class-yoast-notification-center.php
The following paths are ignored by one of your .gitignore files:
wp-content/plugins/wordpress-seo/admin/class-yoast-notification-center.php
Use -f if you really want to add them.
fatal: no files added
@jlengstorf
jlengstorf / .gitignore
Created June 12, 2014 17:14
.gitignore
*~
.DS_Store
.svn
.cvs
*.bak
*.swp
Thumbs.db
Icon
Icon*
@jlengstorf
jlengstorf / related-posts.php
Last active August 29, 2015 14:06
A simple way to load related posts using WordPress categories.

Automatically Set a Featured Image on WordPress Posts

Add these functions to your functions.php to automatically assign a featured image for each post.

Usage

This function must be called within the loop. The first parameter is the post content, and the second is the image size to load.

php
@jlengstorf
jlengstorf / README.md
Last active August 29, 2015 14:07
Base typography for Hoverboard child themes

Default Typography for WordPress

Use this file to set up default responsive typography rules for a WordPress site.

WordPress Aligment Classes

Includes out-of-the-box support for WordPress alignment classes (.aligncenter, .alignleft, .alignright).