WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Gallery
[resolved] activate a gallery from the .php custom template php, not page content (5 posts)

  1. pddiaz
    Member
    Posted 3 years ago #

    Can somebody tell me if its possible to activate or call a next gen gallery from the .php and not from the page content?

    Right now I am using the - [nggallery id=1]

    But can I use a php function to call it from the .php so I can do more specific styling to the custom template page?

  2. Joseph
    Member
    Posted 3 years ago #

    You can use the do_shortcode function or:

    global $nggdb;
    $gallery = $nggdb->find_gallery($gid);

  3. pddiaz
    Member
    Posted 3 years ago #

    How would I write this in the .php page though? I'm learning PHP, but have a ways to go...

  4. Joseph
    Member
    Posted 3 years ago #

    You can use the shortcode method by inserting, for example, echo do_shortcode('[nggallery id=1]'); which would output HTML according to the NGG templates.

  5. pddiaz
    Member
    Posted 3 years ago #

    That did it, thanks for your help Joseph P..

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.