Support » Plugins and Hacks » [Resolved] [Plugin: File Gallery] New templates not recognized and settings ignored

[Resolved] [Plugin: File Gallery] New templates not recognized and settings ignored

  • Hi,

    I’m having problems getting my custom file gallery template to work. I duplicated the default template folder and renamed it to cycle. I then put the following code inside a post:
    [gallery include="215,212,213" template="cycle" size="full" link="none" columns="0"]

    If I then look up the source code on the page, I can see that the css file is in there with the correct link to the template folder:

    However, it does not pick the corresponding gallery.php but uses the one from the default template. It also wont put the correct class to the starttag: <div id="gallery-1" class="gallery default">

    In addition, the name of the new template does not show up in the template dropdown. I tried to deactivate/activate it (with and without use of “Delete all options on deactivation?”), but had no luck so far. I also noticed that if e.g. I use the code [gallery include="215,212,213"] it won’t use the settings (for size, link, columns) I’ve made on the settings page but the default ones. So I always have to write all the options in the shortcode to get the desired result.

    Any idea what’s wrong here?


Viewing 15 replies - 1 through 15 (of 25 total)
  • Having a similar issue.
    Have you resolved?

    No, not yet. I first thought it might interfere with another plugin. But after deactivating every other plugin, the problem was still there.

    Plugin Author Aesqe


    @charger15, @lukehm:

    1.) those “default” File Gallery options on the Media Settings page are used to set defaults for File Gallery metabox on post editing screen only.

    They do not have any impact on visual display of your galleries. Anything you set there as “default” value will be shown as the default value for an option in the File Gallery metabox.

    In RC12, I’ve finally added a notice to the Media Settings page, because this issue has already confused way too many people 😀

    2.) Regarding custom templates:

    I can’t tell you exactly when I’ve changed this, but any custom template placed in the plugin folder will be ignored. Please place your custom templates in your theme’s directory, in a subdirectory called “file-gallery-templates” (you can filter this location using two filters: “file_gallery_templates_folder_url” and “file_gallery_templates_folder_abspath”).

    Also, I’ve been ‘moving things around’ in the code, and I’ve forgot to add a value to one of the constant-turned-variable’s (so no custom template worked in RC11), but I’ve fixed it in RC12 and will release it shortly.

    Thank you for your patience and your bug reports! 🙂

    Thanks for that.
    Will wait for RC12
    I like the idea of the templates being in the theme folder. Much easier for updates.
    One other question. In a template I wanted to add the attachmentID to a class/id does one of the varibles contain the id?
    Thanks in Advance

    Plugin Author Aesqe


    @lukehm: you can use the variable $attachment in your templates, it’s an post object that contains current attachment’s data.

    So, to get the ID, just use $attachment->ID.


    Plugin Author Aesqe


    RC12 is out, please test your custom templates against it. Thanks! 🙂

    You can download File Gallery 1.7-RC12 from here: http://downloads.wordpress.org/plugin/file-gallery.1.7-RC12.zip.

    php file being picked up in theme folder great thanks you
    no stylesheets appear to load not even columns.css
    I’m using file_gallery_shortcode in the template if thats important

    Plugin Author Aesqe


    Yes, if you’re calling file_gallery_shortcode() from within your templates, then you must enqueue CSS files manually.

    [gallery] shortcode is parsed before WordPress gets to your theme, so CSS files can be enqueued automatically and show up in document header.

    But when you use file_gallery_shortcode(), document header is already processed, and CSS files cannot be linked from within document body.

    Makes sense
    Will enqueue or add relvant styles to my style.css
    Many thanks again

    Last question I think
    If I select the featured image using FG is it possible to exclude this from the gallery.
    Maybe tag it and exclude that tag.
    I suppoose I could get the featured image id in the FG template and add a variable. Would that be $exclude?

    Still working on the custom templates

    This time using the [gallery] shortcode in a post
    If I use one of your templates, both gallery.css and columns.css are enqueued
    If still using the gallery shortcode I use a custom template, only the custom gallery.css is enqueued not the standard columns.css.
    Do I need to add this file to my file-gallery-templates folder?

    On another issue exclude does not appear to be functioning, either using [gallery] in a post or file_gallery_shortcode. It does work however if I disable FG handling of [gallery] shortcode.

    I hope this is helpful. I love the plugin

    Plugin Author Aesqe


    That’s by design – “columns.css” is included only if you’re using one of the default templates.
    As it’s a small file, best if you just copy its contents into your template’s CSS.

    Regarding exclude: thanks for catching that – I recently switched all attachment queries to use WP_Query class directly, as opposed via get_posts(), and forgot to change ‘exclude’ parameter to ‘post__not_in’.

    I’ll release RC13 tomorrow, thanks again 🙂

    Thank YOU (:i
    Slightly off piste
    What does a cevapcici and a beer cost these days in Zagreb – or do you prefer coffee?

    Plugin Author Aesqe


    @lukehm: shouldn’t be more than 5-6 euros 🙂

    And I actually do prefer coffee these days 😀

Viewing 15 replies - 1 through 15 (of 25 total)
  • The topic ‘[Resolved] [Plugin: File Gallery] New templates not recognized and settings ignored’ is closed to new replies.