Support » Plugin: WordPress Gallery Plugin - NextGEN Gallery » How can I convert this old code to work with the latest version of NGG Gallery?

  • Resolved ChrisHPZ


    Hi Nextgen. Recently, we updated the plugin from a very old version. As such, a fatal error is triggered due to an old function being removed.

    $ngen = new NextGEN_Shortcodes; 
    echo $ngen->show_gallery(array("id"=>'ticker', "template"=>"ticker", 'images'=>100));

    With that said, is there a way I can convert the old code above to a shortcode that would work? I thought something like do_shortcode would have done the job. But all I get is array where the images should be displayed. Thanks in advance

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support gabyimagely


    Hello @chrishpz

    Could you please try something similar to this?
    Yo need of course to replace, fix the gallery display or id according to your requirements.

    $shortcode = do_shortcode('[ngg src="albums" ids=“3" display="basic_compact_album"]');
    echo apply_filters('the_content', $shortcode);

    Please, let us know if that worked for you.

    • This reply was modified 1 year, 1 month ago by gabyimagely.

    Thank you Gaby. I did as instructed with the gallery display and id. Now I get a new error message:

    “We cannot display this gallery”

    Plugin Support Jaime Imagely


    Hi @chrishpz

    Did you verify your gallery is in Gallery > Manage Galleries and the ID is correct?

    Hi @jaimeimagely yes the gallery in question is showing in the Manage Galleries page. The ID is 1. Below is the code I’m using:

    $shortcode = do_shortcode('[ngg src="galleries" ids="1" display="basic_compact_album"]');
    echo apply_filters('the_content', $shortcode);
    Plugin Support mihai-imagely


    Hi @chrishpz,

    You can’t use the album display type for a gallery. Please use any from the available gallery display types slugs instead then try again.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How can I convert this old code to work with the latest version of NGG Gallery?’ is closed to new replies.