• Resolved mrdumont

    (@mrdumont)


    Using Premium version – slideshow is not working, only loader image is displayed, firebug shows gallery images are not listed.

    If I deactivate the optimizer plugin the slideshow works fine.

    in my theme: <?php echo do_shortcode('[slideshow id="1" w="885" h="171"]'); ?>

    I have reviewed all related topics – checked that there is more than one image in the gallery containing the slideshow, made sure the ‘Activate Permalinks (ngg options)is not checked.

    Really like the plugin but NEED the slideshow – thanks!

    http://wordpress.org/extend/plugins/nextgen-gallery-optimizer/

Viewing 1 replies (of 1 total)
  • Plugin Author Mark Jeldi

    (@mark-jeldi)

    Hi mrdumont,

    Thanks for downloading NextGEN Gallery Optimizer Premium, and thanks for taking the time to read the documentation!

    I have been working on do_shortcode support for templates for quite some time now, but I’ve discovered that, like with widgets, WordPress cannot currently detect the presence of a do_shortcode call until after the head of a page has been processed. By then, it’s too late to load the required scripts (loading them in the footer often causes them to break).

    However, I have recently come up with a solution! It involves adding options to Optimizer’s settings page whereby users can choose to conditionally load their required scripts and styles wherever they like. (eg. slideshow scripts on homepage only or on certain posts or pages etc).

    I hope to integrate this in the next version, but in the meantime…

    If you add the following to the top of nextgen-optimizer-premium-extras.php (just after the opening <?php tag), you can instruct the slideshow scripts to load on whichever pages you want them to (before WordPress even detects your do_shortcode call)…

    /**********************************************************************
    * conditionally add slideshow scripts for do_shortcode call in theme
    **********************************************************************/
    
    function nggop_do_shortcode_slideshow() {
    	global $post;
    	global $nggop_nextgen_options;
    
    	if (is_single()) {
    
    		if (have_posts()) {
    			while (have_posts()) {
    				the_post();
    
    				if (isset($nggop_nextgen_options['enableIR']) && ($nggop_nextgen_options['enableIR'] == '1')) {
    
    					// if jr image rotator is switched on at gallery --> options --> slideshow
    					add_action('wp_enqueue_scripts', 'nggop_load_jr_image_rotator', 1001); // load last
    
    				} else {
    
    					// else load scripts for built-in jquery slideshow
    					add_action('wp_enqueue_scripts', 'nggop_load_jquery', 1000);
    					add_action('wp_enqueue_scripts', 'nggop_nextgen_slideshow_scripts', 1001); // load last
    					add_action('wp_head','nggop_jquery_no_conflict_inline_js', 1000);
    
    				}
    
    				add_action('wp_print_styles', 'nggop_load_nextgen_styles', 1000); // see scripts-and-styles.php for function
    
    			}
    		}
    	}
    }
    add_action('wp','nggop_do_shortcode_slideshow');

    The code above is set to run conditionally on Post pages only, but you can change the line “if (is_single()) {” to whatever you like…eg is_home for the homepage, is_page(‘about’) for your About page. For a full list of conditionals, please see this Codex page.

    Hope this helps!

    Cheers,
    Mark.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: NextGEN Gallery Optimizer] Slideshow not working – optimizer premium’ is closed to new replies.