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
// Fix YouTube embeds | |
$('iframe[src*="youtube"]').each(function() { | |
var url = $(this).attr("src"); | |
$(this).attr("src",url+"?wmode=transparent"); | |
}); |
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
<ul class="feed events"> | |
<?php | |
global $post; | |
$args = array( | |
'numberposts' => 3, | |
'category' => 3, | |
'meta_key' => 'event_date', | |
'meta_value' => date("Y-m-d"), | |
'meta_compare' => '>=', | |
'orderby' => 'meta_value', |
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
$(document).scroll(function(e) { | |
var nav = $('nav'), | |
page = $('body'), | |
scrollValue = page[0].offsetTop - window.pageYOffset; | |
if(scrollValue < -20 ) { | |
nav.addClass('scrolled'); | |
} | |
else { | |
nav.removeClass('scrolled'); |
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 | |
// Anchor when erroring | |
add_filter("gform_confirmation_anchor", create_function("","return true;")); | |
// Error message | |
add_filter("gform_validation_message", "change_message", 10, 2); | |
function change_message($message, $form){ | |
//return "Failed Validation - " . $form["title"]; | |
return "<strong class=\"message error\">Please complete the required fields and try again</strong>"; |
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 shortcode_your_shortcode() { | |
ob_start(); | |
include (TEMPLATEPATH . '/inc/your-template.php'); | |
$output_string = ob_get_contents(); | |
ob_end_clean(); | |
return $output_string; | |
} | |
add_shortcode('SHORTCODE', 'shortcode_your_shortcode'); |
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
<? | |
// Remove columns from Tags section and add Tag ID | |
// ------------------------------------------------------------- | |
add_filter('manage_edit-post_tag_columns', 'my_post_tag_columns', 5); | |
function my_post_tag_columns($defaults) { | |
$defaults['tag_id'] = 'Tag ID'; | |
unset($defaults['description']); | |
unset($defaults['slug']); | |
return $defaults; |
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
// Simple Slideshow | |
$(function () { | |
var visibleClass = 'visible'; // no . | |
var currentClass = 'current'; // no . | |
var animationTime = 300; // fade duration | |
var containerClass = '.slides'; // class on container | |
var slideItem = 'img'; // what are we sliding? | |
var slideItems = $(containerClass).find(slideItem); // all slides | |
var slideNumbers = $(".slide-nav a"); // pagination numbers | |
var slideNext = $(".next"); // next link |
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 my_query_excerpt($page) { | |
global $post; | |
$save_post = $post; | |
$post = get_post($page); | |
$output = '<p>' . get_the_excerpt() . '</p>'; | |
$post = $save_post; | |
return $output; | |
} |
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 | |
// Remove <img> dimensions | |
// ------------------------------------------------------------- | |
add_filter( 'post_thumbnail_html', 'remove_thumbnail_dimensions', 10 ); | |
add_filter( 'image_send_to_editor', 'remove_thumbnail_dimensions', 10 ); | |
add_filter( 'the_content', 'remove_thumbnail_dimensions', 10 ); | |
function remove_thumbnail_dimensions( $html ) { | |
$html = preg_replace( '/(width|height)=\"\d*\"\s/', "", $html ); |
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 | |
/* | |
Plugin Name: FixWpCaption | |
Plugin URI: # | |
Description: Removes inline CSS from .wp-caption | |
*/ | |
class FixWpCaption{ | |
public function __construct(){ | |
add_filter('img_caption_shortcode', array($this, 'fixcaption'), 10, 3); |