- Install node.js: http://nodejs.org/
- Install grunt.js: http://gruntjs.com/getting-started
- In the Terminal:
$ cd [directory]
- Either create
package.json
and use data in this gist'spackage.json
, or run$ npm init
and folow the steps - Make sure to add
"grunt": "latest"
indevDependencies
if you usenpm-init
to create thepackage.jason
file - Install Grunticon in the project:
$ npm install --save-dev grunt-grunticon
- Create
Gruntfile.js
and use data from theGruntfile.js
in this gist. Tweak grunticon file paths as needed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a id="mobile-menu-toggle" href="#">Menu</a> | |
<nav id="main-nav" class="closed"> | |
<ul> | |
<li><a href="#">One</a></li> | |
<li><a href="#">Two</a></li> | |
<li><a href="#">Three</a></li> | |
<li><a href="#">Four</a></li> | |
<li><a href="#">Five</a></li> | |
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$tax_name = 'tax_name'; | |
$terms = get_terms($tax_name); | |
$count = count($terms); | |
if ( $count > 0 ){ | |
foreach ( $terms as $term ) { | |
echo '<section class="' . $term->name . '">'; | |
echo '<h2 class="section-title">' . $term->name . '</h2>'; | |
echo '<ul>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php $images = get_field('gallery'); if( $images ): ?> | |
<ul class="thumb-grid"> | |
<?php foreach( $images as $image ): ?> | |
<li> | |
<a href="<?php echo $image['url']; ?>"> | |
<img src="<?php echo $image['sizes']['thumbnail']; ?>" alt="<?php echo $image['alt']; ?>"> | |
</a> | |
</li> | |
<?php endforeach; ?> | |
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Basic WordPress Widget Code | |
* Save to: /wp-content/theme/widgets.php | |
* in functions.php or appropriate place: if ($wp_version >= 2.8) require_once(TEMPLATEPATH.'/widgets.php'); | |
* | |
*/ | |
class MyWidgetName extends WP_Widget | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$args = array( | |
'post_type' => 'attachment', | |
'numberposts' => -1, | |
'post_status' => null, | |
'post_parent' => $post->ID | |
); | |
$attachments = get_posts( $args ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Numeric Page Navigation | |
function bones_page_navi() { | |
global $wp_query; | |
$bignum = 999999999; | |
if ( $wp_query->max_num_pages <= 1 ) | |
return; | |
echo '<nav class="pagination">'; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(grunt) { | |
grunt.initConfig({ | |
watch: { | |
css: { | |
files: '**/*.scss', | |
tasks: ['compass'], | |
}, | |
}, | |
compass: { // Task | |
dist: { // Target |