Skip to content

Instantly share code, notes, and snippets.

View earthjibber's full-sized avatar

Eric Biboso earthjibber

View GitHub Profile
@earthjibber
earthjibber / wp_query_cpt.php
Last active July 24, 2018 04:01
wp_query for custom post types
// ericB way
// good reference for all wp_query paramaters - http://www.billerickson.net/code/wp_query-arguments/
<?php
$args = array(
'post_type' => 'press',
'posts_per_page' => -1,
//////Taxonomy Parameters - Show posts associated with certain taxonomy.
//Important Note: tax_query takes an array of tax query arguments arrays (it takes an array of arrays)
//This construct allows you to query multiple taxonomies by using the relation parameter in the first (outer) array to describe the boolean relationship between the taxonomy queries.
@earthjibber
earthjibber / vertical align mixin
Last active August 29, 2015 14:16
Vertical Align SCSS mixin
@mixin vertical-align {
position: relative;
top: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}
.element p {
@include vertical-align;
@earthjibber
earthjibber / accordion
Last active November 3, 2015 20:28
An easy accordion without using a plugin, also includes a wp shortcode
// sweet accordion effect (using jQuery easing plugin)
$('.detail-title').click(function() {
var $f = $(this),
$content = $(this).next('.content');
if(!$f.hasClass('menu-expanded')) {
$f.addClass('menu-expanded');
$content.stop().slideDown(666, 'easeInOutExpo');
} else {
// spacer shortcode
// [spacer height="50"]
function spacer_func( $atts ) {
extract (shortcode_atts( array(
'height' => '',
), $atts ));
$height = ($height) ? ' '.$height : '';
return '<div class="spacer cf" style="height:'. $height .'px"></div>';