Skip to content

Instantly share code, notes, and snippets.

View kalenjohnson's full-sized avatar

Kalen Johnson kalenjohnson

View GitHub Profile
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
@kalenjohnson
kalenjohnson / wp_all_posts_in_category
Created December 6, 2013 22:30
Wordpress Show all posts in each category
<?php
$category_IDs = get_all_category_ids();
// Loop through categories
foreach ( $category_IDs as $category_ID ) :
$query = new WP_Query( array(
'cat' => $category_ID,
'posts_per_page' => - 1,
) );
svn: E195023: Commit failed (details follow):
svn: E195023: Changing directory '/media/Stuff/Work/Wordpress/wordpress-php-error-page/trunk/img' is forbidden by the server
svn: E175013: Access to '/!svn/txr/925808-kiub/php-error-page/trunk/img' forbidden
@kalenjohnson
kalenjohnson / gist:9fb75f48342d8537899a
Created June 27, 2014 17:27
Walker Nav with Drawer
<?php
/**
* Cleaner walker for wp_nav_menu()
*
* Walker_Nav_Menu (WordPress default) example output:
* <li id="menu-item-8" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-8"><a href="/">Home</a></li>
* <li id="menu-item-9" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-9"><a href="/sample-page/">Sample Page</a></l
*
* Roots_Nav_Walker example output:
* <li class="menu-home"><a href="/">Home</a></li>
jQuery(document).ready(function($) {
$(window).on('load resize orientationchange',aspectRatioRespond);
aspectRatioRespond();
});
function aspectRatioRespond(){
mobileMax = 480;
elements = jQuery('[data-ratio]');
elements.each(function(){
container = jQuery(this);
<div id="primary" class="content-area site-archives col-xs-12">
<?php if( function_exists('bcn_display') ) {
bcn_display();
} ?>
<main id="main" class="site-main" role="main">
<?php while ( have_posts() ) : the_post();
get_template_part( 'content', 'page' );
@kalenjohnson
kalenjohnson / gist:ec15d227583ce3f4fcd2
Created August 15, 2014 18:17
Show loader on page
(function($) {
jQuery(window).load(function($){
// Turn off the page loader
jQuery('#ajax-loader').fadeOut(500);
});
})(jQuery);
@kalenjohnson
kalenjohnson / gist:3ea4ca428cf504f62261
Created August 23, 2014 00:14
WP_Query specific taxonomy and sticky post
$competitor->featured = new WP_Query([
'post_type' => 'train',
'train-categories' => 'workouts',
'posts_per_page' => 2,
'post__in' => get_option( 'sticky_posts' ),
]);
@kalenjohnson
kalenjohnson / functions.php
Created August 28, 2014 05:23
Wordpress - Fix custom post type archive and active menu classes
<?php
// Taken from http://wordpress.org/support/topic/why-does-blog-become-current_page_parent-with-custom-post-type
function remove_parent_classes($class) {
// check for current page classes, return false if they exist.
return ($class == 'active') ? FALSE : TRUE;
}
add_filter('nav_menu_css_class', function ($classes) {
switch (get_post_type())
@kalenjohnson
kalenjohnson / _header.less
Last active August 29, 2015 14:06
no padding at col-md
.banner {
.search-container {
@media (min-width: @screen-md-min) and (max-width: @screen-md-max) {
padding: 0;
}
}
}