Skip to content

Instantly share code, notes, and snippets.

View billrobbins's full-sized avatar

Bill Robbins billrobbins

View GitHub Profile
@billrobbins
billrobbins / all-menu-items.php
Created January 16, 2012 18:26
Show All Menu Items On Page
<?php $posts = query_posts( $query_string . '&orderby=menu_order&order=asc&posts_per_page=-1' ); ?>
@billrobbins
billrobbins / span-with-style.html
Created January 16, 2012 18:52
Quick span with inline style
<span style="color: #993300;">Your content.</span>
@billrobbins
billrobbins / header-image.php
Created January 17, 2012 16:57
Agency Theme Header
<?php if (is_category('3')) { ?>
<img src="http://www.yoursite.com/image-cat-3.jpg" />
<?php } elseif (is_category('2')) { ?>
<img src="http://www.yoursite.com/image-cat-2.jpg" />
<?php } else { ?>
<?php ot_cycle(); ?>
@billrobbins
billrobbins / page-center.php
Created January 18, 2012 03:33
Picture Page Centered
<?php
/*
Template Name: Picture Page Center
*/
?>
<?php get_header(); ?>
<div id="front">
<div id="home">
@billrobbins
billrobbins / simple-link.html
Created January 19, 2012 14:40
Simple Link
@billrobbins
billrobbins / lower-posts.php
Created January 19, 2012 15:48
Foundation Lower Posts
<div id="home-posts">
<?php $recent = new WP_Query("cat=" .of_get_option('home_cat'). "&showposts=10"); while($recent->have_posts()) : $recent->the_post();?>
<div class="post-highlight clearfix">
<a href="<?php the_permalink() ?>" rel="noindex"><?php the_post_thumbnail('home-thumbnail'); ?></a>
<h4><a href="<?php the_permalink() ?>" rel="noindex"><?php the_title(); ?></a></h4>
<p class="post-meta"><?php the_time('F j, Y'); ?>&nbsp;/&nbsp;<a href="<?php the_permalink(); ?>#comments"><?php comments_number(__('Make A Comment'), __('1 Comment'), __('% Comments')); ?></a>&nbsp;/&nbsp;<?php the_category(', ') ?></p>
<?php the_content_limit(275, "Read More"); ?>
</div>
<?php endwhile; ?>
<?php wp_reset_query(); ?>
@billrobbins
billrobbins / google-plus-link.html
Created January 25, 2012 03:43
Google Plus Link
@billrobbins
billrobbins / header-tabs.php
Created January 31, 2012 21:03
Open social media links in new tab
<p>
<?php if(of_get_option('intro', $single = true) != ""){ ?>
<em><?php echo of_get_option('intro'); ?></em>
<?php } ?>
<?php if(of_get_option('flickr', $single = true) != ""){ ?>
<a target="_blank" href="<?php echo of_get_option('flickr',''); ?>"><img class="fix" src="<?php bloginfo('template_url'); ?>/images/flickr.png" alt="" /></a>
<?php } ?>
<?php if(of_get_option('youtube', $single = true) != ""){ ?>
<a target="_blank" href="<?php echo of_get_option('youtube'); ?>"><img class="fix" src="<?php bloginfo('template_url'); ?>/images/youtube.png" alt="" /></a>
<?php } ?>
@billrobbins
billrobbins / thumb-title.php
Created February 4, 2012 23:53
thumbnail or title
<?php if ( has_post_thumbnail()) { ?>
<?php } the_post_thumbnail(); { ?>
<?php } else { ?>
<h1><?php the_title(); ?></h1>
<?php } ?>
@billrobbins
billrobbins / all-home.php
Created February 9, 2012 16:22
All Categories On Homepage
<?php $recent = new WP_Query("cat=&showposts=".of_get_option('home_cat_num'). ""); while($recent->have_posts()) : $recent->the_post(); ?>