Skip to content

Instantly share code, notes, and snippets.

View aijodesigns's full-sized avatar

Allison Stuefer aijodesigns

View GitHub Profile
@aijodesigns
aijodesigns / page-blog.php
Last active August 29, 2015 14:12
WordPress Blog Archive and Single Post Snippits
<?php
/*
Template Name: Blog Archive
*/
get_header(); ?>
<!-- default page layout -->
<div id="main" class="blog-archive">
<div class="row">
<div class="col-md-9 col-sm-12 col-xs-12 pull-right">
@aijodesigns
aijodesigns / gist:c94084c14786a7f15506
Created December 31, 2014 15:44
Featured Image as Background [WordPress]
<?php if (has_post_thumbnail( $post->ID ) ): ?>
<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' );
$image = $image[0];
?>
<div class="interior-featured-image" style="background-image: url('<?php echo $image; ?>'); background-repeat:no-repeat; background-position:center center; background-size:cover;" ></div>
<?php endif; ?>
@aijodesigns
aijodesigns / page.php
Last active August 29, 2015 14:09
(WordPress) Page Layout with Dynamic Sidebar based on Parent Page
<?php
/**
* Template Name: Page Layout
*/
get_header(); ?>
<div id="main" class="row"><div class="container">
<?php
$children = get_pages('child_of='.$post->ID);
@aijodesigns
aijodesigns / gist:1418ceba261d7f93798b
Created October 28, 2014 20:52
Adding Class to UL based on number of child LIs
$(document).ready(function () {
$('#menu-main ul.sub-menu').each(function() {
if ($(this).children('li').length > 7) {
$(this).addClass('large');
}
});
});