Skip to content

Instantly share code, notes, and snippets.

@thefuxia
Created March 27, 2012 12:40
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thefuxia/2215512 to your computer and use it in GitHub Desktop.
Save thefuxia/2215512 to your computer and use it in GitHub Desktop.
Plugin T5 Add Thickbox Support
<?php # -*- coding: utf-8 -*-
/**
* Plugin Name: T5 Add Thickbox Support
* Plugin URI: http://toscho.de/?p=1997
* Description: Enables the Thickbox script for the theme.
* Version: 2012.08.12
* Author: Thomas Scholz <info@toscho.de>
* Author URI: http://toscho.de
* License: MIT
* License URI: http://www.opensource.org/licenses/mit-license.php
*/
add_action( 'wp_enqueue_scripts', 'add_thickbox' );
add_action( 'wp_footer', 't5_thickbox_jquery' );
/**
* Print JavaScript to make linked images thickboxy.
*
* @return void
*/
function t5_thickbox_jquery()
{
?>
<script>
jQuery( 'a img.size-medium, a img.attachment-thumbnail' )
.parent()
.addClass( 'thickbox' )
.attr( 'rel', 'page' );
</script>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment