WordPress.org

Support

Support » Plugins and Hacks » NextGEN Gallery - WordPress Gallery Plugin » [Resolved] [Plugin: NextGEN Gallery] nggShowRandomRecent -> template

[Resolved] [Plugin: NextGEN Gallery] nggShowRandomRecent -> template

  • Hi, How do I create a template for nggShowRandomRecent ?
    I want to echo the image at full size with no link in it …

    I also don’t understand where a full guide/manual about Nextgen Gallery is.

    From google:
    //Show 6 random images using ‘my-template’ from gallery 4
    //(order, number of images, template, gallery ID)
    echo nggShowRandomRecent(‘random’, 6, ‘my-template’, 4);

    I want to customize “my-template”.

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • The behaviour is odd… if I use:
    echo nggShowRandomRecent('random', 1, '', 1);

    It works but shows a “default-templated” picture, I need to customize it.

    If I use:
    echo nggShowRandomRecent('random', 1, 'mytemplate', 1);

    It don’t works (tryed to copy from singlepic.php): the $image array is NULL.

    In the end, I created a function myself copying from nggShowRandomRecent to get random image from ngg gallery.

    My target was to have a random image title for the blog / website.

    function NggRandom($galleryId = 0) {
    
        // get now the recent or random images
        $picturelist = nggdb::get_random_images(1, $galleryId);
    
    $out = '<a href="'.get_bloginfo('url').'" title="'.get_bloginfo('name').'"><img src="'.$picturelist[0]->imageURL.'" title="'.get_bloginfo('name').'" alt="'.get_bloginfo('name').'" /></a>';
    
        return $out;
    }

    Of course the template tag is:
    <?php echo NggRandom (ID); ?>

    Nice one! This has always been a tricky thing with NextGen, & I have often had to hack the core plugin files.

    This method is so simple, thanks heaps for posting your findings

    Nokao — just a major thank you for the random image function. It was exactly what I needed for the gallery template I was creating! So grateful that I don’t have to edit the plugin files! Thanks!

    @nokao

    thanks a lot. you saved me.

    wow 🙂

    youre wellcome

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Resolved] [Plugin: NextGEN Gallery] nggShowRandomRecent -> template’ is closed to new replies.
Skip to toolbar