• Hello,

    I must be blind because all I can find are shortcode examples which are used in wordpress.

    Does anyone know how I can call nextgen via php particularly an Album.

    Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Our resident PHP genius, Scott Kingsley Clark, found this hidden in the plugin. This is how you can pull a gallery, slideshow or album into a template via PHP hook:

    <?php echo nggShowSlideshow([id],[width],[height]); ?>

    Let me know if that works

    Thread Starter degrama

    (@degrama)

    yes an no, your answer generated errors not sure why but i googled

    nggShowSlideshow

    and come up with

    function nggShowAlbum($albumID,$mode = “extend”)

    =

    <?php echo nggShowAlbum(1) ?>

    And yes that works!

    <?php echo nggShowSlideshow([id],[width],[height]); ?>

    This works for me. Just had to replace the entire [id],[width],[height], with values like so:

    <?php echo nggShowSlideshow(1,120,120); ?>

    I do have the JW Image Rotator, so it’s working great now. Thanks for the suggestion stefan-vizion.

    -Ben

    Are there more php codes I can use for NextGen?
    For example to show the latest 4 images of a special gallery?

    You can look in nggfunctions.php to identify all the NextGen functions, see the parameters used, and try calling them in your php files. you can also use <?php echo do_shortcode(‘[album=1 template=compact]’); ?>

    I use <?php echo nggShowSlideshow(1,120,120); ?> and have the JW Image Rotator.

    Showing two slideshows in the header from two diffrent gallerys, all works fine, until you go to a sub page then the slideshow doesnt display!?

    The homepage and all first level pages work fine!

    Any ideas of what the problem can be!?

    have you included wp_head on the theme header ?

    I just dont understand why there’s a nice documentation about shortcodes but not php functions.

    I mainly work with php and custom template pages… how am I supposed to work with shortcodes… ok I can look in the core files and extract the functions I need… but I just dont understand why the same documentation wasn’t done for php functions too.

    Guess the easiest thing to do, to show Album n.1 for example, is:

    <?php echo do_shortcode('[nggallery id=1]'); ?>

    Just get the normal shortcode in there and let wordpress core functions sort it out ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Plugin: NextGEN Gallery] PHP to use Nextgen in Themes’ is closed to new replies.