Title: [Plugin: File Gallery] file gallery single.php
Last modified: August 20, 2016

---

# [Plugin: File Gallery] file gallery single.php

 *  [old_blueyes](https://wordpress.org/support/users/old_blueyes/)
 * (@old_blueyes)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-file-gallery-file-gallery-singlephp/)
 * Hi,
 * I am experiencing problems calling file gallery from my single.php file.
 * I have used every which way you can add shortcode into template files do_shortcode
   and file_gallery_shortcode.
 * But no matter what settings I have set within the shortcode they dont take effect.
 * Everytime they just display as they are now:
 * [http://www.vsc.im/new/?p=1](http://www.vsc.im/new/?p=1)
 * I wish to use the simple (javascript) template, with thickbox it all works fine
   if i put shortcode straight into WordPress. But I want to avoid that.
 * Hope you can help?
 * Thanks
 * [http://wordpress.org/extend/plugins/file-gallery/](http://wordpress.org/extend/plugins/file-gallery/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Aesqe](https://wordpress.org/support/users/aesqe/)
 * (@aesqe)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-file-gallery-file-gallery-singlephp/#post-2339842)
 * **[@old_blueyes](https://wordpress.org/support/users/old_blueyes/):**
 * when calling the shortcode directly from the template, the CSS and JavaScript
   files are NOT enqueued automatically – you’ll have to do that manually.
 * The reason for this is, the CSS <link> tags must be in the <head> of the document,
   and since you’re calling the shortcode from within your template, the head part
   is already generated.
 * The only way would be to use JavaScript to inject the CSS <link> in the document
   after it has loaded – but I really don’t think that’s an generally acceptable
   solution.
 *  [Francesco Canovi](https://wordpress.org/support/users/thedarkmist/)
 * (@thedarkmist)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-file-gallery-file-gallery-singlephp/#post-2339896)
 * Aesque,
    since it’s becoming an emerging request, I suggest to implement a tutorial
   or integrate a solution directly in the plugin. The possibility to embed the 
   gallery EASILY in a template file would be a killer feature, as this would give
   a great control to theme developers. Best regards
 *  Plugin Author [Aesqe](https://wordpress.org/support/users/aesqe/)
 * (@aesqe)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-file-gallery-file-gallery-singlephp/#post-2339904)
 * **[@thedarkmist](https://wordpress.org/support/users/thedarkmist/):**
 * I’ll write up a tutorial to explain best practices when using the shortcode within
   template files.
 * And this could be a way to do it from the plugin point of view:
 * add a new attribute to the shortcode, ‘force_enqueue’ (true or false)
 * if set to true, enqueue javascript files in footer and, depending on a second
   new attribute – ‘force_enqueue_css’ (‘inject’ or ‘inline’), inject css links 
   into header using javascript (I really dislike this part), or get css file contents
   and prepend them inline to HTML (in HTML5, if used with the ‘scope’ attribute,
   <style> tags are allowed inside <body>)
 * I’ll think some more about it, but, without output buffering, I don’t think there’s
   another way to do it…
 * I’ll definitely write up a tutorial as soon as I can 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘[Plugin: File Gallery] file gallery single.php’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/file-gallery_fdfbfb.svg)
 * [File Gallery](https://wordpress.org/plugins/file-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/file-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/file-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/file-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/file-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/file-gallery/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [Aesqe](https://wordpress.org/support/users/aesqe/)
 * Last activity: [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-file-gallery-file-gallery-singlephp/#post-2339904)
 * Status: not resolved