Skip to content

Instantly share code, notes, and snippets.

View bpmore's full-sized avatar

Brent Passmore bpmore

View GitHub Profile
<?php
/**
* Get post image.
*/
function wds_get_post_image( $size = 'thumbnail' ) {
// If featured image is present, use that
if ( has_post_thumbnail() ) {
return get_the_post_thumbnail( $size );
@bradpotter
bradpotter / style.css
Last active November 3, 2016 16:58
Full Width Slider on Education Pro Theme
.education-pro-home #genesis-responsive-slider {
max-width: 100%;
}
.education-pro-home .flexslider {
max-width: 100%;
}
.education-pro-home .flexslider .slides img {
width: 100%;
@tomfinitely
tomfinitely / gist:65bbd2dc0a660a06b5e7
Created June 3, 2014 15:31
Genesis 2.0 Conditional CSS for Internet Explorers 7 & 8
//* Conditional CSS
add_action( 'wp_enqueue_scripts', 'child_add_ie8_style_sheet', 200 );
function child_add_ie8_style_sheet() {
global $wp_styles;
wp_enqueue_style( 'child-ie8', get_stylesheet_directory_uri() . '/style-ie8.css', array(), '1.0' );
$wp_styles->add_data( 'child-ie8', 'conditional', 'lte IE 8' );
}
add_action( 'wp_enqueue_scripts', 'child_add_ie7_style_sheet', 200 );
function child_add_ie7_style_sheet() {
@kisabelle
kisabelle / wp-assign-parent-template.php
Created January 22, 2014 19:04
WordPress: Automatically Apply Parent Page Template to Child Pages by Matovu Richard
<?php
function switch_page_template() {
global $post;
// Checks if current post type is a page, rather than a post
if (is_page())
{
// Checks if page is parent, if yes, return
if ($post->post_parent == 0)
return true;
else if ($post->post_parent != $post->ID)
@grtaylor2
grtaylor2 / gist:5960970
Created July 9, 2013 20:26
Code to DELETE from home.php file to remove blog posts from Genesis Minimum home page layout.
add_action( 'genesis_loop', 'minimum_grid_loop_helper' );
function minimum_grid_loop_helper() {
if ( function_exists( 'genesis_grid_loop' ) ) {
genesis_grid_loop( array(
'features' => 0,
'feature_image_size' => 'featured',
'feature_image_class' => 'post-image',
'feature_content_limit' => 0,
'grid_image_size' => 0,
@isGabe
isGabe / get-highlight-terms.php
Last active February 12, 2022 16:22
WordPress: Output a list of taxonomy terms, then highlight the terms the belong to the current post. Updated to use in_array() to add a "current" CSS class to terms that the current post has. This way we don't have to worry about keeping up with terms in the CSS. Hooray for logic! #snippet #WordPress
<?php
/*
As the title implies, this will give you a way to
1. output a complete list of terms for a given taxonomy (nothing special there)
2. highlight the terms that the current post has (the magic!)
Probably need to figure out a better way to echo out the url of the term archive page...
*/
@srobbin
srobbin / gist:3799775
Created September 28, 2012 13:15
Random Backstretch image
<script>
// Create an array of images that you'd like to use
var images = [
'image1.jpg'
, 'image2.jpg'
, 'image3.jpg'
];
// Get a random number between 0 and the number of images
var randomNumber = Math.floor( Math.random() * images.length );