@katmac_aus – Unfortunately without knowing the details and specifics of your WP_Query call it’s very difficult to say what may or may not be missing … the first thing to review (as a quick thought) is how the NextGEN Gallery inserted display details are being generated?
Thanks!
– Cais.
Let me provide some more detail. I have a page called category which runs a WP Query to get a specific product page. The product page is displayed within the category page with get_template_part('content');.
In the content template, it gets a custom variable that stores the ID of the gallery to display. It then displays the gallery as follows:
<?php echo do_shortcode('[ngg_images source="galleries" container_ids="'.$gallery_id.'" display_type="photocrati-nextgen_basic_imagebrowser" ajax_pagination="1" order_by="sortorder" order_direction="ASC" returns="included" maximum_entity_count="500"]'); ?>
This works to output the product with the next gen image browser on the page, within the category page. EG the page contains…
Category heading
Category content
Specific Product – title, gallery blurb
You can see the gallery but clicking on the buttons does nothing.
But when you view product pages individually the galleries work.
This is why I am thinking that this method is not triggering some script to load???
Update: I noticed that the code is actually running and it does get as far as sending the ajax request but the repsonse does not work. I think this is because the page URL has a query parameter in it which mucks up the next gen JS. Eg the page url is mydomain.com/category?pid=1.
SOLVED! This is was indeed the use of query strings in the url. I updated nextgen_gallery_display/common.min.js with code from common.js and edited it to remove the query string from url parameter in the AJAX request as follows (from line 40):
var full_url = $(this).attr('href');
var url_parts = full_url.split("?");
var pre_url = url_parts[0];
// Send the AJAX request
$.get(pre_url, function (response) {
//continue normal code...
@katmac_aus – Thanks for the updates!
Please feel free to send us a PR with your changes, otherwise you may need to keep a back-up reference to your changes and make them with each update.
Here is our public repo: https://bitbucket.org/photocrati/nextgen-gallery
Thanks, again!
– Cais.