Skip to content

Instantly share code, notes, and snippets.

View JLeuze's full-sized avatar

Josh Leuze JLeuze

View GitHub Profile
@JLeuze
JLeuze / page_home.php
Created February 8, 2014 06:25
Homepage featured slideshow for Hatch Pro Theme
<?php
/**
* Template Name: Home
*
* A custom page template for displaying the homepage.
*
* @package Hatch Pro
* @subpackage Template
*/
@JLeuze
JLeuze / header.php
Created February 22, 2014 01:22
Homepage Header slideshow for Twenty Fourteen Theme
<?php
/**
* The Header for our theme
*
* Displays all of the <head> section and everything up till <div id="main">
*
* @package WordPress
* @subpackage Twenty_Fourteen
* @since Twenty Fourteen 1.0
*/
@JLeuze
JLeuze / name-widget-plugin.php
Last active August 29, 2015 14:02
A widget for adding your name in a sidebar.
<?php
/*
Plugin Name: Name Widget
Description: A widget for adding your name in a sidebar.
Plugin URI: https://gist.github.com/JLeuze/475bdd6bd6095b7bdf7c
Author: Josh Leuze
Author URI: http://www.jleuze.com/
License: GPL2
Version: 1.0
*/
@JLeuze
JLeuze / functions.php
Last active August 29, 2015 14:02
A widget for adding your name in a sidebar.
<?php
/**
* Adds Name widget.
*/
class JL_Name_Widget extends WP_Widget {
/**
* Register widget with WordPress.
*/
function __construct() {
@JLeuze
JLeuze / jl-random-posts-simple.php
Created February 24, 2012 20:41
Simple plugin for random posts shortcode
<?php /*
Plugin Name: JL Random Posts */
function jl_random_posts() {
$jlrandom_output = '';
$jlrandom_loop = new WP_Query( array( 'posts_per_page' => 3, 'orderby' => 'rand' ) );
while ( $jlrandom_loop->have_posts() ) : $jlrandom_loop->the_post();
$jlrandom_output .= '<li><a href="' . get_permalink() . '">' . the_title( '', '', false ) . '</a></li>';
endwhile;
wp_reset_query();
return '<ul>' . $jlrandom_output . '</ul>';
@JLeuze
JLeuze / jl-random-posts.php
Created February 24, 2012 22:39
Plugin for random posts shortcode
<?php
/*
Plugin Name: JL Random Posts
Plugin URI: http://www.jleuze.com/plugins/jl-random-posts/
Description: Load a list of random posts.
Version: 1.0
Author: Josh Leuze
Author URI: http://www.jleuze.com/
License: GPL2
*/
@JLeuze
JLeuze / msp-wp-demo-functionality.php
Created February 24, 2012 23:05
Functionality plugin for MSP WordPress Demo
<?php
/*
Plugin Name: MSP WP Demo Functionality
Plugin URI: https://gist.github.com/1904421
Description: Functionality plugin for MSP WordPress Demo
Version: 1.0
Author: Josh Leuze
Author URI: http://www.jleuze.com/
License: GPL2
*/
@JLeuze
JLeuze / meteor-caption.php
Created May 7, 2012 18:16
Meteor Slides Sample Caption
<div class="meteor-caption">
<h4><?php the_title(); ?></h4>
<?php the_excerpt(); ?>
</div><!-- .meteor-caption -->
@JLeuze
JLeuze / meteor-excerpts.php
Last active October 5, 2015 00:47
Plugin to add excerpts to Meteor Slides
<?php /*
Plugin Name: Meteor Excerpts
Description: Adds excerpts to Meteor Slides.
Author: Josh Leuze
Author URI: http://jleuze.com/
Version: 1.0
*/
function meteorslides_add_excerpt() {
add_post_type_support( 'slide', 'excerpt' );
@JLeuze
JLeuze / replace.js
Created May 19, 2012 18:48
Find and replace WordPress search widget button text with jQuery
jQuery(document).ready(function() {
jQuery('.widget_search').each(function (i) {
jQuery(this).html(jQuery(this).html().replace('value="Search"', 'value="Go"'));
});
});