Support » Plugin: NextGEN Gallery - WordPress Gallery Plugin » [Plugin: NextGEN Gallery] imagelist not working in posts

  • I am trying to insert an imaglist into a post using the code [nggallery id=x] (where x is the gallery ID of course) but for some reason the tag is not parsed and instead of the imagelist the post outputs the code ([nggallery id=x]). Everything works fine in a page, but not in a post.

    After trying the code for slideshow or imagebrowser I got the same result – the code isn’t parsed but still part of the output. So for some reason NextGEN only works in a page, but not in a post? What am I doing wrong?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Did you checked if is the text editor that is scaping the code?
    Try to write the code in html mode, save it and check.

    Usually I use HTML mode so it is not the text editor. Just to be safe I tried several ways:

    • writing the code manually (or copying from a page where it works) in HTML
    • writing the code manually (or copying from a page where it works) in visual
    • using the NextGEN dialog to insert a gallery (tried all variants (list, browser, slideshow), result is always the same – the code is outputted)

    At first I thought that maybe the plugin wasn’t called when a post is parsed so the code doesn’t get replaced in the output. I tried the old way to insert a NextGEN gallery using the code [gallery=x] but this outputs [nggallery id=”x”] so apparently the plugin is called and does … something. Just not what it is supposed to do …

    Did some testing to see if other plugins might affect NextGEN (I am running YAPB too for example), but still no luck. Other plugins apparently have no effect on the parsing (or not parsing …) of the code.

    Any ideas? I’d really like to use NextGEN in posts and not only in pages 🙁

    I have the same problem. Works on pages, but not posts. I’m in version 3.01.

    Ok, did some more digging around. I am almost sure it has something to do with the shortcode handling of WP.

    I have a post and a page which have exactly the same content, both ending with [nggallery id=x]. On the page the NextGEN code gets replaced correctly, on the post it remains in the output. Diving further into both WP’s shortcode.php and NextGEN’s shortcode.php I can verify that in both cases all functions get called, all attributes are parsed correctly, the regular expressions used are absolutely identical and the callback functions returns the same (correct) output. The only difference is that the shortcode in the post doesn’t get replaced – despite using the same regular expression as the page, getting the same input, callback functions returning the same output …

    What’s the difference between a post and a page that could have this effect?

    I am at a loss. Any help would be greatly appreciated.

    *desperation bump*

    Anyone?

    I have the same problem, did you foun something about it ?

    Thank you

    All I can offer is a workaround. In my single.php instead of just outputting the content I first call the do_shortcode function.

    $content = get_the_content();
    $content = apply_filters('the_content', $content);
    $content = str_replace(']]>', ']]& gt;', $content); // Note: remove the space between & and gt ...
    echo do_shortcode($content);

    Not the most satisfying solution, but for now it works.

    Great!!

    Thank you.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: NextGEN Gallery] imagelist not working in posts’ is closed to new replies.