WordPress.org

Ready to get started?Download WordPress

Forums

NextCellent Gallery - NextGEN Legacy
Gallery name above gallery thumbnail display (4 posts)

  1. VesaT
    Member
    Posted 3 months ago #

    Did you know you can get your gallery name to show on top of your gallery thumbnail view with a fairly small code edit? This is handy e.g. in cases where you have selected the gallery from an album containing several galleries.

    What you need to do is to locate 'gallery.php' file within your WP installation plugin folder: ../wordpress/wp-content/plugins/nextcellent-gallery-nextgen-legacy/view/gallery.php. Make a copy of this file in case you want to revert back to the original NextCellent gallery thumbnail view.

    Locate the following piece of code which is the second operational row of code:
    <div class="ngg-galleryoverview" id="<?php echo $gallery->anchor ?>">
    and insert after this row your title display code as follows (you may change the text into your own language and/or something more relevant to you):

    <p><H3>GAllery: <?php echo $gallery->title ?></H3></p> <!-----------------show Gallery Title-------------------->
    
    <h3><a href="<?php the_permalink(); ?>" title="Back to Album">« Back to album: <?php the_title(); ?></a></h3> <!--a link back to the calling album/page-->

    The first inserted code row will show the gallery title, the second a link back to the album (or other gallery selection) page. Delete the second row if you do not want to display the link back.

    Save the file into its original location. Since these are hard-coded changes, make a copy from this edited file as any NextCellent upgrade will replace this file during the upgrade process - so always after upgrade copy this edited into your ../view folder.

    I think it would be nice to have this as a standard option within the basic NextCellent. Hope it will happen soon.

    https://wordpress.org/plugins/nextcellent-gallery-nextgen-legacy/

  2. niknetniko
    Member
    Posted 3 months ago #

    You can save this change as a new template to make it more update-proof.

    Make a new folder called nggallery in your theme folder and save the file in there as gallery-NAME.php.

    To use this template, do
    [nggallery id=x template=NAME]

  3. VesaT
    Member
    Posted 3 months ago #

    @niknetniko: you mean save the whole gallery.php file into .../themes/nggallery/ and then call it as a template in gallery display? If that is what you mean, I certainly will give it a try!

    But... as the gallery title display on pages is very handy when calling the gallery thumbnail view from an album, this probably would not work on those cases? Or would it?

  4. VesaT
    Member
    Posted 3 months ago #

    @niknetniko: sorry, read your comment badly. Your suggestion works, ie. saving gallery.PHP into ../themes/mytheme/nggallery folder with name gallery-NAME.PHP. So, thanks for the suggestion :)

    It does not however work on gallery views which have been selected from an album - that still needs the actual gallery.php edits.

    Showing gallery title especially with galleries selected from albums would be most beneficial. This should be a general option within NextCellent for displaying galleries.

Reply

You must log in to post.

About this Plugin

About this Topic