• I was wondering how to code the gallery on my home page within a div tag. instead of having it visible only in a post. I have tried the following with no luck..

    <div id="featured">
       <?php include (ABSPATH . '/wp-content/plugins/nextgen-gallery/nggallery.php'); ?>
    </div>

    Is it possible, and if so how would I do it?

    Great plugin by the way.

    Thanks
    Chris

Viewing 4 replies - 1 through 4 (of 4 total)
  • If you are asking how to include NextGen galleries in template files (such as your index.php file) instead of in posts or pages you can use this method:

    <?php
    $showalbum = '[album=AlbumName,compact]';
    $showalbum = apply_filters('the_content', $showalbum );
    echo $showalbum;
    ?>

    The above method defines a variable which stores the nextgen gallery shortcode. You need to change AlbumName to the name of the Album you want to display. The variable, containing the shortcode, is then passed through the content filter which will render out the gallery to your template file when the page is loaded.

    Hope that helps.

    what about the widget plugin? I have it installed on my sidebar using the widget editor but I want to place it on the index.php file to call the most recent photos from all albums.

    Also, any idea how you can increase the number of photos the widget shows…it is currently set to a maximum of 9.

    Thanks.

    Thread Starter facecjf

    (@facecjf)

    churchthemer,

    Thank you! That worked. You have to change '[album=AlbumName,compact]'; to [gallery=ID] or [slideshow=ID] where the ID is the ID of which ever gallery you want to display.

    Thanks again.

    Glad it worked. I’d only done the filter with albums before, glad to know it works on the other shortcodes as well.

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

The topic ‘[Plugin: NextGEN Gallery]can I php include= this plugin?’ is closed to new replies.