This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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... | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* 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() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.education-pro-home #genesis-responsive-slider { | |
max-width: 100%; | |
} | |
.education-pro-home .flexslider { | |
max-width: 100%; | |
} | |
.education-pro-home .flexslider .slides img { | |
width: 100%; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*** | |
* Gravity Forms: Validate to ensure date fields are not the same or todays date | |
* | |
* This will validate the fields on form submission and return a validation error on the fields in question. | |
* In this case it validates an Arrival and Departure date against each other and today's date. | |
* | |
* Code goes in your theme's functions.php file. | |
***/ | |
add_filter('gform_field_validation','validate_dates',10,4); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"config": { | |
"exclude": [ | |
".git/**", | |
"node_modules/**" | |
], | |
"verbose": true, | |
"always-semicolon": true, | |
"block-indent": "\t", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add this to your functions.php file, excluding the opening <?php | |
add_action( 'wp_head', 'nd_remove_homepage_blog' ); | |
// Remove blog section from homepage | |
function nd_remove_homepage_blog() { | |
if ( is_front_page() || is_home() ) { | |
remove_action( 'genesis_loop', 'genesis_do_loop' ); | |
} | |
} |
OlderNewer