WordPress.org

Forums

File Gallery
[resolved] Error inserting shortcode in page template (5 posts)

  1. mgali002
    Member
    Posted 1 year ago #

    When I insert the shortcode in php

    <? php echo do_shortcode ('[gallery link = "file" template = "simple"]');?>

    on a page-template I have this error:

    http://imageshack.us/a/img692/241/errorpagetemplate.jpg

    Is it possible to fix?

    thanks

    http://wordpress.org/extend/plugins/file-gallery/

  2. Aesqe
    Member
    Plugin Author

    Posted 1 year ago #

    @mgali002: that's because the javascript and css files for the "simple" template didn't load. You can add them manually, just paste the following code at the top of your page template, before get_header:

    <?php
    wp_enqueue_style('file_gallery_simple', FILE_GALLERY_URL . '/templates/simple/gallery.css');
    wp_enqueue_script('file_gallery_simple', FILE_GALLERY_URL . '/templates/simple/gallery.js', '', '', true);
    ?>

    that should work.

  3. mgali002
    Member
    Posted 1 year ago #

    ok Aesqe,

    thanks a lot!!!! :-)

  4. gauriR
    Member
    Posted 1 year ago #

    When I insert the shortcode in php

    <? php echo do_shortcode ('[gallery link = "file" template = "simple"]');?>

    i get blank page i have put before get_header:
    <?php
    wp_enqueue_style('file_gallery_simple', FILE_GALLERY_URL . '/templates/simple/gallery.css');
    wp_enqueue_script('file_gallery_simple', FILE_GALLERY_URL . '/templates/simple/gallery.js', '', '', true);
    ?>
    but still get blank page display, PLEASE HELP ME

  5. Aesqe
    Member
    Plugin Author

    Posted 1 year ago #

    @gauriR: is that blank space between the "?" and "php" in your first code example also present in your file?

    <? php should be <?php

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • File Gallery
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic