Skip to content

Instantly share code, notes, and snippets.

View nickberens360's full-sized avatar

Nick Berens nickberens360

View GitHub Profile
@nickberens360
nickberens360 / gist:b37bbade15f5b56fdcf8
Created July 29, 2014 13:23
Align second line of list item with the first line
ul.disc-aligned {
display: table;
padding-left:20px;
}
ul.disc-aligned > li {
margin-bottom: 5px;
}
ul.disc-aligned > li::before {
@nickberens360
nickberens360 / acf-repeater-code.php
Last active August 29, 2015 14:09
Wordpress: ACF repeater code
<?php if( have_rows('content_blocks') ): ?>
<?php while ( have_rows('content_blocks') ) : the_row(); ?>
<h2><?php the_sub_field('content_block_title'); ?></h2>
<p><?php the_sub_field('content_block_content'); ?></p>
<?php endwhile; ?>
<?php endif; ?>
@nickberens360
nickberens360 / gist:286717199041b02115ac
Created November 13, 2014 21:43
Wordpress: jQuery noconflict
jQuery( document ).ready(function( $ ) {
// Code that uses jQuery's $ can follow here.
});
@nickberens360
nickberens360 / wordpress: order by acf datepicker
Created December 8, 2014 20:52
Order wp_query by acf date picker
<?php
$args = array(
'post_type' => 'event',
'orderby' => 'event_date menu_order',
'order' => ASC,
'posts_per_page' => -1,
'meta_key' => 'event_date'
);
$query = new WP_Query( $args );
?>
@nickberens360
nickberens360 / wordpress: Title tag
Last active August 29, 2015 14:11
Wordpress: Title Tag
<title>
<?php
if (function_exists('is_tag') && is_tag()) { echo 'Tag Archive for &quot;'.$tag.'&quot; - '; }
elseif (is_archive()) { wp_title(''); echo ' Archive - '; }
elseif (is_front_page()) { wp_title(''); }
elseif (is_search()) { echo 'Search for &quot;'.wp_specialchars($s).'&quot; - '; }
elseif (!(is_404()) && (is_single()) || (is_page())) { wp_title(''); echo ' - '; }
elseif (is_404()) { echo 'Not Found - '; } bloginfo('name');
?>
</title>
@nickberens360
nickberens360 / blog.iml CSS
Created January 5, 2015 14:54
blog.iml CSS
.blog-body {
border-right: 2px dotted #DCDCDC;
padding-right: 24px;
}
#bread {
display: none;
}
.blog-main {
@nickberens360
nickberens360 / 0_reuse_code.js
Last active August 29, 2015 14:13
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
ul {
list-style: none;
padding:0;
margin:0;
}
li {
padding-left: 1em;
text-indent: -.7em;
}
@nickberens360
nickberens360 / new_gist_file.php
Created June 10, 2015 15:25
Bootstrap: dynamically add carousel indecators ***PHP VERSION***
<ol class="carousel-indicators slideNav">
<?php if( have_rows('slide') ): ?>
<? $i = 0; ?>
<?php while ( have_rows('slide') ) : the_row(); ?>
<li data-target="#carousel-example-generic" data-slide-to="<?php echo $i; ?>" class="<? if($i === 0): ?>active<? endif; ?>"></li>
<? $i++; ?>
<?php endwhile; ?>
<?php endif; ?>
</ol>
@nickberens360
nickberens360 / new_gist_file.php
Created June 12, 2015 17:29
wordpress: add masonry to wp
if (! function_exists('slug_scripts_masonry') ) :
if ( ! is_admin() ) :
function slug_scripts_masonry() {
wp_enqueue_script('masonry');
wp_enqueue_style('masonry', get_template_directory_uri().'/css/');
}
add_action( 'wp_enqueue_scripts', 'slug_scripts_masonry' );
endif; //! is_admin()
endif; //! slug_scripts_masonry exists