Laudde
Member
Posted 6 months ago #
Hello all,
I am using NextGEN Gallery which is a great plug-in for your albums etc. It has a lot of options, one of them is Number of columns.
I was wondering, is it possible to set the Number of columns for each page? I have some gallery's where I want only 3 colums and an other page with 6 coluns. (It is possible to set it to 0 but that everything mess itself up.)
So where in the code do I have to make some changes?
http://wordpress.org/extend/plugins/nextgen-gallery/
It looks like the column control display code is in /nextgen-gallery/view/ directory? Which file to edit depends on which gallery shortocde you use. As I use the gallery-caption option I'd have to edit the gallery-caption.php file.
You could hardcode some/all gallery names setting some/all with a column value. Or, avoid hardcoding names by naming your galleries with a suffix like -3 and -6. When the updated code runs it could check the suffix and set the number of colums accordingly. That way the code doesn't need updating each time you add a new gallery.
I don't know php so cant help with that part.
Laudde
Member
Posted 6 months ago #
Thanks for your reply mikeg9999,
I am just using [nggallery id=x]
It would be nice to change the shortcode with a suffix like this:
[nggallery id=x col=3]
I found in the following code in /nextgen-gallery/nggfunctions.php
// fixed width if needed
$gallery->columns = intval($ngg_options['galColumns']);
$gallery->imagewidth = ($gallery->columns > 0) ? 'style="width:' . floor(100/$gallery->columns) . '%;"' : '';
If somebody could help me with this, that would be nice. My knowledge of php is also not the best. But I will try it myseld.
I like the [nggallery id=x col=3] suggestion.
jeroen1973
Member
Posted 6 months ago #
Laudde, I was looking for an option like this too. I have fixed this through CSS for now by changing the width. You can see the result here, hope it helps you:
http://www.akershoek.com/portfolio/24-uur-binnenhof/
div#ngg-gallery-X-YYY { width: 370px; float: right; }
X is the gallery-id and YYY the page-id
An option to do [nggallery id=x col=2] would be great indeed!
Laudde
Member
Posted 6 months ago #
Hi Jeroen,
Nice job. And than you set columns=0?
I still want to [nggallery id=x col=2] option. That would be awesome.
jeroen1973
Member
Posted 6 months ago #
That's right, columns = 0
However, the option you are suggesting would be better!
robotect
Member
Posted 6 months ago #
Please make yourself familiar with the template option like this:
[nggallery id=1 template=sample1]
You may google for it, this will solve your problem. Regards, Uli