-
thornParticipant
Hi,
i’m having troubles with the size of the pictures in the build in Lightbox.
They are shown smaller as i uploaded them. Is there a trick to show them bigger?
And my Posts are empty because i had to remove the added images, as they were shown twice. I don’t use any gallery tags or anything else.
I don’t know if it helps, but here you can find the page im working with:
wp.seelenfaenger.biz
Sorry for my bad english, but im not a native speaker.
Thx for the GREAT theme and greetings from GermanyjmuirwalesParticipantHi,
I’m really new to WordPress and slowly learning. I also want to increase the size of the lightbox. I have opened up the functions.php but can’t find what I should be modifying. Please could somebody give me some guidance? Also, should I be making any modifications in a child theme?
Thanks.
Daniel TaraKeymasterThe lightbox adapts to screen size. If it would show images bigger they would overflow the screen.
jmuirwalesParticipantHi Daniel,
Thanks got your reply. I’m not sure I quite understand. Currently the lightbox does not appear to adapt as even if my web browser is maximized on a hi res screen the lightbox does not appear any larger, also it does not match the width or height of the page content.
jmuirwalesParticipantUnfortunately my site is not online at the moment. Am I able to include a screen shot here? The images in the current lightbox appear to be approx 700×500.
Daniel TaraKeymasterIt wouldn’t help much. I need to troubleshoot the site’s code to figure out why it’s behaving like this.
jmuirwalesParticipantI found in another post that the following code in the functions.php was responsible for controlling the size.
“jQuery(‘a.colorbox’).colorbox({
maxWidth:800,
maxHeight:600,
});”Is this correct? The default values in my functions.php file seem to be 900×600. If I wanted to modify these should it be done with a child theme?
Thanks for your help.
jmuirwalesParticipantI have now setup a child theme but I need some help getting the child functions.php working. I just want to use it to modify the size of the lightbox. I have tried entering the code above, (and also a few slight variations), but when my child functions.php file is present it causes my website to go completely blank.
I’m sure I am probably just missing a piece of code but i’m not sure what. I would really appreciate it if somebody could provide what the content of my child functions.php should look like.
Thanks.
PCChParticipantjmuirwales;
Unlike the style.css file in a child theme, which can override the parent .css file, the functions.php file of the child theme does not override the parent functions.php file by default.
The purpose of the functions.php file in a child theme is simply to add functionality to the child theme so that those functions will not be overwritten when the parent theme is updated. But these are always new (or added) functions, not overriding functions.
It is possible to override the parent functions.php file, but it requires specific code to be written in both the parent (to cancel [or unhook] the function) file and child (to initiate the new hook and override call to the hook that has been canceled in the parent file) file; and these canceling calls need to be written in different ways depending of how the parent function is called.
The functions.php file is the single most powerful file in a WordPress theme, and you can bring your whole site down if something is amiss there.
I was able to make the box smaller then the default value, but not larger by changing the size values in the colorbox settings. Once I tried to set it larger than the 900px by 600px default, I saw no change in size of the box.
When (if) you are ready to dig into tackling these code changes, here are a few (relatively) entry level articles about how to approach it:
http://venutip.com/content/right-way-override-theme-functions
http://ottopress.com/2010/wordpress-protip-child-themes/
http://wordpress.stackexchange.com/questions/7557/how-to-override-parent-functions-in-child-themes
- This reply was modified 12 years, 3 months ago by PCCh.
gavintfnParticipantPCCh…
well put!.. Sometimes, there is a css style sheet associated with lightbox, or colorbox. or just an image. After changing the functions files, you will still have to find the css file and make the changes there.. That would account for smaller, but not larger.. If the css was still set smaller, even the functions would check that last and limit the size.. Also, many times when you upload a file to WP, it will create multiple sizes of the same image… I could also be pulling that file, say 600 x 400, best way to insure that this doesnt happen is to upload you photos to your site manually, and reference them manualy.
But in any case, for Colorbox…if thats what we are still talking about, there is a couple functions that will override anything you change in regards to standard height… Ill mess with later tonight but in the meantime, if anyone else wants to check it out, it is located in colorbox.js which is in the wpcontent/themes/minimatica/script file…have a look at:
publicMethod.load = function (launched)
can someone post an example? thx…
jmuirwalesParticipantThank you both for taking the time to provide such detailed replies, it has saved me a lot of time and is greatly appreciated. I have now modified the values in the original functions.php file. I guess I will just have to remember to modify them again should the theme be updated in the future.
Just to let you both know, I have increased the default values and the result has been an increase in the lightbox and image size without any detrimental effects.
bhall27ParticipantSo I’m very simple minded and modifying scripts is not something I’m good at. Can someone point out exactly where I need to modify the code in order to make sure my images appear the size I uploaded them at? For example I have a 1920×1280 render of images but they never even get close to that.
see my site at brianhall3d.com I need the images to display atleast close to what I uploaded them at.
You must be logged in to reply to this topic.