• Hi all,

    As we all know, we need to put a code like “[nggallery id=4]” into the wordpress page or post, where 4 is the gallery id that we created.

    In my current situation the URL that I’m browsing is like http://www.blah.com/?page_id=606 where 606 is the page id that I created.
    But I want to have the gallery id from the URL. For example I’ll modify my page.php code and will take the gallery id from URL query string like http://www.blah.com/?page_id=606&mygalleryid=5

    First of all, instead of putting “[ngallery id=4]” code from “Edit Page” of WordPress web admin interface, I put “
    [ngallery id=4]”
    code into “page.php” in FTP (/wp-content/themes/mytheme/page.php). But unfortunately the page rendered
    “[ngallery id=4]” directly to the browser when I browsed the page.

    If it would accept this “[ngallery id=4]” code in page.php, I would be able to put my $mygalleryid variable to this “[ngallery id=4]” string like “[ngallery id=$mygalleryid]”.

    Is there a way to put this “[ngallery id=4]” directly into page.php or post.php ?

    Thanks!

    P.S.: My WordPress is 2.7.1

Viewing 1 replies (of 1 total)
  • Thread Starter farcel

    (@farcel)

    I found the answer by myself 🙂

    Putting the code below in page.php did the trick :

    <?php
    echo do_shortcode(‘[nggallery id=4]’);
    ?>

    FYI

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: NextGEN Gallery] Dynamic gallery id like [ngallery id=$mygid] ?’ is closed to new replies.