There are obviously many ways to install TagTray in Wordpress, particularly if you feel comfortable modifying your theme files. However, for a simple recipe, you can follow these steps.


Setup the TagTray JavaScript

Open up the file header.php in your theme folder, and insert the JavaScript include before the closing </head> tag as documented in Step 2 of the installation docs here.



Inserting Global Galleries

To display a TagTray gallery on your site, add the gallery display snippet to the appropriate page or post following Step 3 of the installation docs here.


Using Shortcodes to Insert JavaScript

Several of our examples (such as using the bxSlider) require the use of JavaScript following the insertion of the TagTray snippet. Wordpress doesn't allow JavaScript directly on the page, but it can be injected by the use of shortcodes. For example, to create a shortcode to configure the bxSlider, adding the following function to functions.php in your theme folder:


//[TagTray Slider Config Script Shortcode]
function tagtray_slider_func( $atts ) {

  return "<script>jQuery('.tagtray-gallery').on('shown.tt.gallery',function(){jQuery('.TagTrayGalleryImages').bxSlider({minSlides:2,maxSlides:6,slideWidth:150,slideMargin:10});});</script>";

}
add_shortcode( 'tagtray_slider', 'tagtray_slider_func' );
            

Then, to inject this JavaScript into your page, use the newly created shortcode as follows:


[tagtray_slider]