Code

Discussion on Justified Image Grid - Premium WordPress Gallery

Discussion on Justified Image Grid - Premium WordPress Gallery

By
Cart 23,132 sales
Recently Updated

Firsh supports this item

Supported

This author's response time can be up to 1 business day.

8469 comments found.

Firsh, Hope you are doing well. I, once again have a very specific situation I hope you can help with, but before I go any further, does JIG have the capability to create a search form for images? And then to have the user Search and Display images by keywords in Titles or excerpts or alt_text or even by taxonomies? I haven’t noticed or am I just missing it?

Well I am looking forward to any updates you put in JIG.

Oh, and just throwing this out there, if you need any “testing” of anything I’m more than happy to help out.

Thank you

Hi, I’m new to working with the filtering option and I have a question – is it possible to have a gallery of lots of images, but have the default/initial view be one of the available filters, not “all photos”? IE the gallery is all fruits, and the filters would be “all, apples, bananas, pears, peaches” etc, but I want the page to initially load with only bananas showing. Is that a possibility that I’m just missing?

This is not (yet) a setting.

If you were to drop the “All” button it would default to the first one.

Otherwise, with some custom JS it’s possible to trigger a click on the filter you need on page load, as if the page selected that automatically for the visitor. JIG settings, General tab, Custom JS, you could add something like: jQuery(document).ready(function() { jQuery('[data-filter-slug="bananas"]').click(); });

Good to know, thank you!

This plugin looks really amazing… Congrats !

Thank you!

JIG is only displaying the first images uploaded to my WP gallery. Images added later are not appearing, even when dragged to the beginning of the gallery. Is there a hidden max image count? When I disable JIG, all images display in the default WP gallery just fine.

I have tried: - Turning off Load More - Turning off filtering - Purging caches - Seeing if mobile & desktop are different (they are not) - Setting “Limit image count” to 0 and to empty - Testing the missing images in a separate (smaller) gallery to ensure the images themselves are not the problem - Making sure JIG is up to date (I’m on 4.5) - Turning off error-checking (no empty spaces) - Making sure there are no special characters in the filenames

Without seeing it live I can’t tell, but maybe the “max rows” setting?

Check your global settings and as well as the grid’s own settings.

Thank you for your reply. ‘Max Rows’ is empty when I look at the General Settings Tab for JIG. I don’t have a specific grid created – I just use the regular WordPress Gallery feature. Does that make a difference? This is the link, if that helps at all: https://www.liferemembered.me/extended-portfolio/

I see a limit of 50 but it’s likely for the load more feature. You got 144 images, is there supposed to be more?

In W3 total cache, your pages are cached, and if you use JIG in a way that it’s suppsoed to “auto catch” new stuff (for example via a shortcode using category/tag) but you are not actually changing or updating the shortcode on such page, then you’ll see stale page from the cache (usually when logged out). So it will not detect that the page cache should be purged just because of new images in the media library.

If you use the “auto take over” feature then your page content does change, so it’s less likely to be due to stale cache.

I have a JIG gallery on my homepage with a single photo for ‘Event 01’. That image has its JIG Link set so that when I click on it, I am taken to a WordPress post that contains another JIG gallery that shows all of the photos for ‘Event 01’, including the image I just clicked on to get here.

My problem is that when I click on the image again on the post page (the same one I clicked on from the homepage), instead of opening Lightbox, it links me back to the post page again because the browser sees and follows the JIG Link.

How do I set a link on the homepage for an image to go to a post page with other photos in that gallery, but while there, if I click on the same image again, it will open the Lightbox and not link back to itself?

There is a disregard custom links option. Where you edit your grid of your normal gallery, find General tab’s Custom link setting and set it to Off.

You can also do the whole thing without manual links. There is a WP Posts mode where you make the homepage gallery automatically using featured images and they handle links to their respective pages.

Your second tip (post mode) was great, thanks!

PHP 7.x deprecated warning message

Optional parameter $rml_lightbox_groups declared before required parameter $rml_entered is implicitly treated as a required parameter in /var/docs/public/wp-content/plugins/justified-image-grid/justified-image-grid-core.php on line 16145

Please fix

public function get_posts_from_rml(
    $original_rml_id,
    $current_rml_id,
    $args,
    $rml_count,
    $rml_description,
    $rml_lightbox_groups = 'no',
    $atts=null,
    $rml_flatten='',
    $rml_entered=''
)

For now, you can remove the = ‘no’ Thanks for the heads up I’ve removed it for the next update.

Great thank you

Clean install with just one grid throws a warning message in php.8.2+

Warning: Attempt to read property “ID” on null in /var/docs/public/wp-content/plugins/justified-image-grid/justified-image-grid-core.php on line 8215

Please fix by checking if post->ID exists

if (isset($post->ID) && $id !== '' && $id != $post->ID) {

Fixed for the next release, that condition didn’t really need to look at $post->ID

Thank you…. i already forgot about it…. lol.

Hello, I have been using NGG and JIG as a perfect combination of plugins since a year. Thank you so much for your providing nice program. The only small issue for me was weak Search function and Tag Cloud search. Basically there is no good search function of images, as I store all images not in Media Library. I found very nice wonderful search plugin “NextGen smart image search”, but unfortunately I can’t use JIG for the output thumbnails list of that tool. I know there is a hack to enable search with JIG as written in the page https://justifiedgrid.com/support/faq/show-search-results-justified-image-grid/ , but it appears too complicated to me. I’m a beginner of PHP and can’t do that modification of many sources. So I tried to use simple method, probably not quite right nor professional, but supposed to work for my small private website.

It’s basic PHP calling JIG shortcode, and I put a variant $val as the search string of the shortcode.

<?php $val = " "; ?>
<form method="post">
Please type search strings here.<input type="text" name="dat" /><input type="submit" value="Search"/>
</form>

<?php
$val = filter_input(INPUT_POST, "dat");
$val = htmlspecialchars($val);

echo ('Current Search strings: '.$val);
echo "<br />";

if (strlen($val) < 3) {
    echo "Search string too short";
}elseif (strlen($val) > 30){
    echo "Search string too long";
}else{
echo do_shortcode('[justified_image_grid preset=4 link_title_field=caption photoswipe_social=yes download_link=yes title_field=off lightbox=photoswipe orderby=rand filterby=on filter_style=tags filter_all_text="Reset to All" filter_orderby=title_asc filter_all_button=yes filter_multiple=and l2_filterby=off l2_filter_style=tags l2_filter_orderby=title_asc l2_filter_multiple=and limit=1500 width_mode=responsive_fallback load_more=click initially_load=100 ng_search_query='.$val.' ng_search_options=tag,description ng_count=yes ng_lightbox_gallery=yes ng_description=no ng_display_tags=no]');
}
?>

I put above PHP file named “gallery_search_en.php” in the child theme’s folder. Then following shorcode is located in a page.

[include_php file=’gallery_search_en’]

To enable PHP running from a Page of Wordpress via shortcode, following modification must be added to function.php. This is the only easy way to run PHP on WordPress page I found after some Internet search. The path to $file.php must be modified for each environment.

function include_my_php($params = array()) {
    extract(shortcode_atts(array(
        'file' => 'default'
    ), $params));
    ob_start();
    include(get_theme_root() . '/' . get_template() . "/../cocoon-child-master/$file.php");
    return ob_get_clean();
}
add_shortcode('include_php', 'include_my_php');

Basically this worked as an independent search page. You can put another search strings repeatedly. Search results are shown with JIG’s tag cloud method, so I can make further narrowing down the image list on the fly. Then, when I wanted to call this search function from a Widget, I added below html text widget, too.

Please enter search string of at least 3 characters.
<form action="https://1wishyouwerehere.com/en/image_search_and_tag_cloud" method="post"><input name="dat" type="text" />
<input type="submit" value="Search" /></form>

The URL as the ‘action’ is the page where I put shortcode [include_php file=’gallery_search_en’]. Then the string typed in the Widget’s input window is handed over to the page. After that, new search can be done either on the page’s input window or on the Widget.

That’s that. Here you can see how it works. Hopefully I can hear any comments of my mistake, insufficient protection or suggestion for improvements. Also, I have no CSS knowledge, so the appearance of the input area is just basic and terrible, although it’s OK for me. Hopefully some of you can make it better looking. https://1wishyouwerehere.com/en/

The remaining question of mine is, how to enable the JIG’s tag cloud tag list more vivid. I’d like to have the line spacing much smaller as even the words each other show some overlapping. And all the tag words color should be randomized. You can see a nice example of “Ultimate Tag Could” Widget on my Japanese page. https://1wishyouwerehere.com/ I can’t stop loving the way of the tag words appear. Unfortunately this plugin isn’t compatible with Bogo’s multilingual website, so I disable it for English page.

I now find that the code I used to handover the text variant to JIG shortcode was not nice. Actually that method doesn’t pass the space character ” ” to ng_search_query. I mean, this code: “echo do_shortcode(‘[justified_image_grid ...... ng_search_query=’.$val.’ .......”. Instead of that, much simply, I could use “get_jig(array(‘ng_search_query’ => $val));”. This method doesn’t drop the space. As all the tag cloud parameters worked fine with this single line code’s default, thus the output image is identical to the long code, I switched to this one on my web site.

The older version needs to have dobule quotes if the value has a space so it would be “’.$val.’” but yeah the other template tag is a bit better in this regard.

BTW The site I've shown you previously uses a static export of a WP site and a custom indexer crawls that (the HTML files). But soon I'll have experience with indexing a live WP site and that can pave the way for having Algolia work with JIG one day.

Thank you Firsh for your prompt support on Sunday (?!). I have read at somewhere that double quotation is required to expand the variants, so I tried ”.$val.” and failed, but not ”’.$val.’”. Now the original code with this modification works with search term containing space. Oh BTW We’re all waiting for your adding wonderful search feature in JIG “some day” :-)

Hello Firsh, hope your Holidays were good. Is there a way to combine 2 different sources for a grid? In my case I want to combine a Real Media Library folder with a Custom Taxonomy.

It’s not yet possible to combine multiple different sources into one, but it’s planned and is definitely something I’m interested in. You can start out with an RML grid, then further narrow it down by custom taxonomy though. With developer hooks I’d explore this https://justifiedgrid.com/support/faq/media-library-query-args/ as RML is just media library under the hood, it could work.

From what I’ve seen, people use Custom Taxonomy to filter the grid with buttons above, but can still use RML at the point of grid creation and organization.

Apologies for two comments. I’m also experiencing a weird bug across all of my sites using this plugin. The images often don’t load automatically. Random images display the loading coloured background then if you wait you see multiple images of the same image minus spacing. It seems to be an issue on Safari only.

Screen one:

https://paulpetch.co.nz/wp-content/uploads/2023/12/Screenshot-2023-12-31-at-6.19.09 PM.png

Screen two:

https://paulpetch.co.nz/wp-content/uploads/2023/12/Screenshot-2023-12-31-at-6.16.07 PM.png

Thanks. Currently set to 500. What do you recommend? Will this fix the images failing to load?

https://www.christchurchheadshotphotographer.co.nz/wp-content/uploads/2024/01/Screenshot-2024-01-09-at-9.22.26 AM.png

That setup indicates thumbs could range from zero to 1000. The tallest row is about 800 on the site. I’d set row height to 800, deviation to 0, and use “disable cropping” setting which will let them decrease to 50.

What could also work is keep row height at 500, make deviation 300.

Whatever you can do to decrease the size of scaled-down thumbnails in the grid would help with memory. Unless it’s the network which I doubt since Jetpack’s CDN is serving you these.

Thanks! Opted to keep tallest at 500 as at 800 it seemed to be low quality. Also set mobile deviation to zero. Hopefully this fixes up the non loading gallery issue. I’ll let you know how it goes.

Merry Christmas. I’ve had some downtime so i’ve been checking on on site load times etc.

If you clear browsing history and visit:

https://www.christchurchheadshotphotographer.co.nz

The JIG loads last on the page slowing the load time dramatically. The delay is quite visual.

If you visit:

https://christchurchphotographer.co.nz

JIG loads instantly. Any idea what this is happening? Thank you!

-Paul

If you temporarily disable litespeed cache does the red notice go away? I haven’t seen it by the way but the nature of defer is that “the script can arrive any time” meaning it’s not consistent when the files load, leading to a sometimes works sometimes doesn’t scenario.

Disabling cache makes no difference. Why is it only on this site I have issues with this plugin? Identical theme and plugins to my other sites using this plugin – and they don’t exhibit this problem. Not sure what the explanation is sorry? Are you saying the plugin by design sometimes just does not work? Ive turned off conditioner script loading as suggested by the error message- is this going to be a problem?

Can I ask my host for error logs? Is there a way to find out what is going on vs guessing?

What I meant is that the configuration of the caching plugin (not JIG) throws off the script loading in a random fashion. You could have the same theme and same plugins, but configured differently so they behave differently.

In your case conditional script loading can remain on, as it’s mainly for AJAX themes.

Just want to say thanks for all of your support this year. I’ve had a few issues and you fixed them and responded quickly here. All the best for 2024.

I appreciate the kind words!

Having an issues where I get a error message ””The image could not be loaded” once again on mobile but desktop seems fine. Have had this in the past and usually turn off plugins form combining javascripts but I went and turned off all plugins and themes with no luck. website is https://www.willpursell.com/

Sorry for the delay. All 12 images load for me on both desktop and an Android device. Is there a particular browser/OS combo where you get this problem?

Those kind of plugins can stay enabled, but usually jQuery needs to be excluded from optimizations to not interfere with inline scripts on the page.

Since the WordPress 6.4.1 update, the Justified Image Grid plugin stopped working. It messes up the website throwing an Ajax error. Is this a known something?

Where do you see an AJAX error and what does it say? If it’s on the frontend can you please send a link?

The Facebook authorization is expiring in a few days. When I click on “Add current Facebook user (and all administered pages), in the Facebook window that opens there is an error: Sorry, something went wrong. We’re working on getting this fixed as soon as we can.

The message log in JIG shows: Access token acquisition wasn’t successful. Please authorize yourself on Facebook then click ‘Manually load Facebook data’. If you already closed the Facebook dialog, click ‘Add current Facebook user’ again.

I tried disabling the cache before adding the Facebook user, it didn’t help.

Thanks, Tom

Contact me through my profile using the account used to purchase JIG with (or let me know what site it’s used on so I can check), and I can send you the latest beta that aims to fix this.

Hi, I’d like to use your plugin but just wondered if it’s possible to have images open up in a lightbox style pop-up with a magnification option to allow for further zooming in? Thanks!

Yes, this built-in lightbox supports zooming in: https://justifiedgrid.com/lightboxes/photoswipe/

That’s great thanks.

LOAD MORE BUTTON CSS – could you provide an example of how you would make the “Load More” button a down arrow instead of displaying text? Is this super easy and I’m just missing something?

Well, you can use HTML in the “Load more text” setting, so if you got a suitable SVG image you can embed it there. For example:

I got it from: https://iconmonstr.com/arrow/

For the “Load more count text” setting either clear the field in the plugin settings, or enter the word none if you are editing a single grid.

For “Load More CSS” in the plugin settings you might want to replace it with something that just gives a boundary for the arrow but doesn’t look like a box. For example:

  padding: 10px;
  margin: 5px auto 15px;
  cursor: pointer;
  width: 50px;
  text-align: center;

And nothing for the “Load more hover CSS” setting.

At https://www.christchurchheadshotphotographer.co.nz there is a delay loading the grid and on occasion I see red text with a java script error briefly pop up prior to it loading. I don’t have this issue on the other sites I have using this plugin- it’s exclusive to this domain.

I worry it fails to load for some visitors which is not the result I want being a commercial site that generates me income. Any ideas on how to test this more and see these errors? Also why is there a considerable delay for it to even load? Thanks!

The caching plugin “defers” the script of the plugin. jQuery is correctly not deferred. I don’t see any errors in the console or see anything else besides the yellow placeholders briefly during loading. If the deferred script takes too long to arrive, that might cause the inline init script of JIG think that it’s not coming. But it wasn’t so in my test as everything is fast (page loads in around 1s). Even when I throttle the speed, there is nothing out of the ordinary, just the thumbnails take longer to arrive.

OK thanks. I’ll keep an eye on it.

I would like to find a compatible third-party plug-in that will provide a simple method to build a form to upload images with title, excerpt, description fields, but also expose JIG Link, JIG Target, and Folder fields. You have this support FAQ on your website, but the suggested plug-in hasn’t been active for over two-years: https://justifiedgrid.com/support/faq/is-it-possible-to-have-frontend-upload-for-visitors/ – could you provide an update and suggest a possible solution that is active/supported? I would think this would be a popular need. I’m familiar with the Flickr option, but would prefer web users not need to sign up for an account with a third-party to simply submit an image to appear in a JIG gallery with appropriate JIG custom fields.

How about those plugins that create fields? Not necessarily for even more fields but WCK pro has this article: https://www.cozmoslabs.com/docs/wordpress-creation-kit-documentation/frontend-posting/

A plugin that hasn’t been updated in 2 years can still work, I use some of those. This frontend upload need is not so popular among JIG support requests so I haven’t been keeping up to date about it. I’d probably approach the issue with a custom solution. Perhaps I could help with that if you can’t find a suitable/free solution. But do look for something that is “close enough” and we could bridge the gap.

by
by
by
by
by
by

Tell us what you think!

We'd like to ask you a few questions to help improve CodeCanyon.

Sure, take me to the survey