Skip to content

Instantly share code, notes, and snippets.

View whyisjake's full-sized avatar
✈️

Jake Spurlock whyisjake

✈️
View GitHub Profile
@whyisjake
whyisjake / gist:5032413
Created February 25, 2013 19:19
Simple image swapper
<?php
$arr = array('http://placekitten.com/300/250', 'http://placekitten.com/400/150');
$shuffle = array_rand($arr, 1);
// print_r($shuffle);
echo '<img src="' . esc_url( $arr[$shuffle] ) . '" />';
@whyisjake
whyisjake / gist:4990287
Created February 19, 2013 21:40
Sponsor Slider
<div id="sponsor-area" class="featured">
<h3>Maker Faire Sponsors</h3>
<div id="sponsorCarousel" style="height:240px;margin-top:10px;margin-bottom:10px;" class="carousel slide sponsorCarousel">
<div class="carousel-inner" style="background-color:#fff;">
<div class="item active">
<div class="table-cell">
<a href="http://www.radioshack.com/home/index.jsp"><img style="margin-left:10px;width:280px !important;" src="http://makezineblog.files.wordpress.com/2012/08/radioshack.gif?w=280" alt="RadioShack" valign="center" title="RadioShack" /></a>
</div>
</div>
<div class="item">
@whyisjake
whyisjake / index.php
Created February 19, 2013 04:01
Conditional to see if a post has a parent. If it does, show the sidebar-custom.php, if not, just show sidebar.php.
<?php
if($post->post_parent !== 0) {
get_sidebar( 'custom' );
} else {
get_sidebar();
}
@whyisjake
whyisjake / index.php
Created February 19, 2013 04:01
Conditional to see if a post has a parent. If it does, show the sidebar-custom.php, if not, just show sidebar.php.
<?php
if($post->post_parent !== 0) {
get_sidebar( 'custom' );
} else {
get_sidebar();
}
@whyisjake
whyisjake / index.txt
Created February 19, 2013 04:00
Conditional to see if a post has a parent. If it does, show the sidebar-custom.php, if not, just show sidebar.php.
Test
@whyisjake
whyisjake / index.txt
Created February 19, 2013 04:00
Conditional to see if a post has a parent. If it does, show the sidebar-custom.php, if not, just show sidebar.php.
<?php
if($post->post_parent !== 0) {
get_sidebar( 'custom' );
} else {
get_sidebar();
}
@whyisjake
whyisjake / index.php
Created February 19, 2013 03:59
Conditional to see if a post has a parent. If it does, show the sidebar-custom.php, if not, just show sidebar.php.
<?php
if($post->post_parent !== 0) {
get_sidebar( 'custom' );
} else {
get_sidebar();
}
@whyisjake
whyisjake / index.php
Created February 19, 2013 03:58
Conditional to see if a post has a parent. If it does, show the sidebar-custom.php, if not, just show sidebar.php.
<?php
if($post->post_parent !== 0) {
get_sidebar( 'custom' );
} else {
get_sidebar();
}
@whyisjake
whyisjake / index.php
Created February 19, 2013 03:58
Conditional to see if a post has a parent. If it does, show the sidebar-custom.php, if not, just show sidebar.php.
<?php
if($post->post_parent !== 0) {
get_sidebar( 'custom' );
} else {
get_sidebar();
}
@whyisjake
whyisjake / index.php
Created February 19, 2013 03:58
Conditional to see if a post has a parent. If it does, show the sidebar-custom.php, if not, just show sidebar.php.
<?php
if($post->post_parent !== 0) {
get_sidebar( 'custom' );
} else {
get_sidebar();
}