Skip to content

Instantly share code, notes, and snippets.

View digisavvy's full-sized avatar

Alex Vasquez digisavvy

View GitHub Profile
@digisavvy
digisavvy / wp_query_has_caps.php
Last active August 29, 2015 14:19
WP Query to display posts current user has capabilities to see
<?php
$args = array(
'post_type' => 'course',
'perm' => 'readable',
'order' => 'ASC',
'orderby' => 'title',
'posts_per_page' => -1,
'READ_ACCESS' => 'read_access',
'post__not_in' => array( 1271 )
@digisavvy
digisavvy / ninja-forms-foobox-popup.php
Last active August 29, 2015 14:20
Ninja Forms and Foobox Popup
<?php
if( function_exists( 'ninja_forms_display_form' ) ){
echo '<div id="ninja_form" style="display: none;">';
echo "<h3>Class Enrollment Inquiry Form</h3>";
ninja_forms_display_form( 1 );
echo "</div>";
}
?>
<span class="white-cta">
<a href="#ninja_form" target="foobox" data-width="600px" class="white-cta">Enroll Now</a>
.search-box-wrapper .search-field {
box-sizing: border-box;
width: 280px;
}
dev-antaeus.artedev.info/media="all"
.search-box-wrapper .search-field {
z-index: 1;
position: absolute;
float: none;
@digisavvy
digisavvy / new_gist_file.php
Created May 29, 2015 13:24
Right Things Banner
<section id="section-banner">
<span class="banner_noresponsive"><?php
$bannerarea = get_field("banner");
if($bannerarea == ""){
?>
<?php }else{ ?>
<img src="<?php echo get_field("banner"); ?>">
<?php } ?></span>
<span class="banner_responsive"><?php
$bannerarea_responsive = get_field("banner_responsive");
<?php
if ( 'movie' == get_post_type() ) {
/* Custom code for 'movie' post type. */
} elseif ( 'book' == get_post_type() ) {
/* Custom code for the 'book' post type. */
}
@digisavvy
digisavvy / load-page.js
Last active August 29, 2015 14:27
Use jquery to load a file into a div via an onclick event. Needed to do this to load a pageview on a single page, multi-step app where multiple pageviews needed to be recorded
jQuery(function ($) {
$(document).ready(function(){
$(".page1").click(function(){
$('#pageloader').load('path/to/file.html');
});
});
}
define('EDD_SLUG', 'my-downloads-slug');
@digisavvy
digisavvy / flexbox-col-test.css
Created August 23, 2015 19:14
Flexbox Column Test
.gallery {
overflow: auto;
zoom: 1;
display: flex;
flex-direction: row;
}
.gallery-columns-3 figure {
width: 33%;
float: left;
height: 370px;
@digisavvy
digisavvy / wc-prod-type-checker.php
Created September 11, 2015 06:32
Check WooCommerce Product Type
<?php
if( $product->is_type( 'simple' ) ){
echo "is simple product";
} elseif( $product->is_type( 'variable' ) ){
echo "is variable";
} elseif( $product->is_type( 'composite' ) ){
echo "is composite";
} else {
echo "derpage";
<head>
<!--[if IE]><![endif]-->
<link rel='stylesheet' id='kfalkner-font-awesome-css' href='//netdna.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css?ver=4.4.0' type='text/css' media='all' />
<link rel="stylesheet" href="http://www.kristinfalkner.com/wp-content/cache/min/1/d55b692a1c3c0173104fb1e29befc0a7.css" data-minify="1" />
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Custom WordPress Work, PSD to WordPress, Los Angeles WordPress Developer, Web Design &amp; Development | Kristin Falkner</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="alternate" type="application/rss+xml" title="Kristin Falkner RSS Feed" href="http://www.kristinfalkner.com/feed/" />