Skip to content

Instantly share code, notes, and snippets.

View billrobbins's full-sized avatar

Bill Robbins billrobbins

View GitHub Profile
@billrobbins
billrobbins / newsletter-bar-progress.php
Created November 9, 2011 05:19
Progress Newsletter Form Action
<?php echo "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>
<div class="paging">
<?php if(function_exists('wp_pagenavi')) : wp_pagenavi(); else: ?>
<p class="paging-next left">
<?php next_posts_link(__('&laquo; Next', 'organizedthemes')); ?>
</p>
<p class="paging-prev right">
<?php previous_posts_link(__('Previous &raquo;', 'organizedthemes')); ?>
</p>
<?php endif; ?>
@billrobbins
billrobbins / gist:1408040
Created November 30, 2011 04:39
Foundation Slideshow Shortcode
// create slideshow shortcode
function organizedthemes_home_slideshow() { ?>
<div id="slider">
<?php $loop = new WP_Query( array( 'post_type' => 'slide', 'posts_per_page' => -1, 'orderby'=>'menu_order', 'order'=>'ASC' ) ); ?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<a href="<?php echo get_post_meta($post->ID, "slideurl", TRUE); ?>"><?php the_post_thumbnail('slide'); ?></a>
<?php endwhile; ?><?php wp_reset_query(); ?>
</div>
<?php }
@billrobbins
billrobbins / media-home.php
Created December 2, 2011 20:34
Media Theme Home Buttons
<div id="home-right">
<?php if(ot_option('button_1_image', $single = true) != ""){ ?>
<div class="fix fade image-button">
<a href="<?php echo ot_option('button_1_url'); ?>"><img src="<?php bloginfo('template_directory'); ?>/includes/timthumb.php?src=<?php echo ot_option('button_1_image'); ?>&amp;h=127&amp;w=174&amp;zc=1" height="127" width="174" alt="<?php echo ot_option('button_1'); ?>" /></a>
</div>
<?php } else { ?>
<div class="fix button">
<h2><a href="<?php echo ot_option('button_1_url'); ?>"><?php echo ot_option('button_1'); ?></a></h2>
</div>
<?php } ?>
@billrobbins
billrobbins / comments-template-add.php
Created December 5, 2011 15:54
Add Comments Template
<?php comments_template(); ?>
@billrobbins
billrobbins / page-donate-agency.php
Created December 12, 2011 16:51
Agency Theme Donate Page Template
<?php
/*
Template Name: Donate Page
*/
?>
<?php get_header(); ?>
<div id="header-background">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
@billrobbins
billrobbins / ot-cycle-script.php
Created December 13, 2011 12:40
Slideshow Loading
<script type="text/javascript">
var $j = jQuery.noConflict();
$j(window).load(function() {
$j('#slider').nivoSlider({
effect:'<?php echo $ot_cycle_settings['effect']; ?>',
animSpeed:500,
slices:1,
pauseTime:<?php echo ($ot_cycle_settings['delay'] * 1000); ?>,
directionNav:false
});
@billrobbins
billrobbins / content-from-specific-wordpress-page-slug.php
Created December 13, 2011 17:06
Add Content From Specific Page
<?php if (is_home()) { ?>
<?php
// Query for Home Page Content
$the_query = new WP_Query( 'pagename=home' );
// The Loop
while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
@billrobbins
billrobbins / clear-fields.js
Created December 14, 2011 20:14
Clear Gravity Forms Fields
$(document).ready(function() {
$.fn.cleardefault = function() {
return this.focus(function() {
if( this.value == this.defaultValue ) {
this.value = "";
}
}).blur(function() {
if( !this.value.length ) {
this.value = this.defaultValue;
@billrobbins
billrobbins / foxy-background-to-footer.php
Created December 15, 2011 14:46
foxy background edit