Home / Forums / DynamiX Support / prettyPhoto customization

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts

  • Mickaël BELLAMY
    Participant

    Hi all,

    I made a Masonry Grid with Visual Composer and a customized grid element. When I click on the image, I want it to display the image in prettyPhoto light box, which is working, but I would like also to display the image description, and customize a bit the lightbox colors (specially the colors of title, which are white on a black background).

    Here’s my page: http://new.topeaks.fr/media/

    If someone can tell me where I can customize the CSS it would be nice.

    Thanks a lot!

    Andy
    Andy
    Keymaster

    Hi Mickaël,

    It seems you have disabled the lightbox now. Your best bet is to use the “Chrome” browser and right click the element you want to customize and select “Inspect Element”, this will give you the CSS class for what you’re trying to change, you can enter this into Appearance > theme Options > Customize > Custom CSS.

    Unfortunately if you require further help, it would have to be a customization.


    Mickaël BELLAMY
    Participant

    Hi Andy,

    Thanks for you answer, didn’t know you could manage CSS directly on the inspector element…So I did some changes about CSS, but when I refresh the page it comes back to the original…how do I save my changes?

    Now, something I don’t understand, is when I go on element inspector with those photos, I get “Fancybox” reference,, and I find some lines in CSS about Fancybox, but not about prettyPhoto…And I got JS files with both of them…So which plugin does the website really use for display the photos, and in which file can we do some changes to add the photo description? Because on functions.php we call Fancybox.js and not prettyphoto…So I’m a bit lost…

    Thanks for your answer.

    Andy
    Andy
    Keymaster

    Sorry, I meant you can see what changes the CSS needs and then copy the changes into Appearance > Theme Options > Customize > Custom CSS.

    Visual Composer uses PrettyPhoto.


    Mickaël BELLAMY
    Participant

    Hi Andy,

    Thanks for your answer. I’ll finally not use prettyPhoto for this page, but the attachment page.

    The problem I have now, is that default attachment page. What I’m trying to find is how I can customize a bit this “default” page (I’ve already put the title in center instead of left, which is a huge thing for the beginner I am), especially the image size. When I inspect the element with Chrome on this page by example (http://new.topeaks.fr/media/barriere/), I get this HTML Line:

    <img width="300" height="169" src="http://new.topeaks.fr/wp-content/uploads/2015/08/Barrière-300x169.jpg" class="attachment-medium" alt="Barrières de foule">

    I know that the image get this size thanks to the class=”attachment-medium” and I would like to change this class, to put a bigger image on this page (not full size but just under, 1024×939 as WordPress create them when I upload images), but I don’t see where this class is called from on the files.

    I searched a lot on google and apparently, I should create an attachment.php file that comes over the single.php file for the full customization. But even if I’m copying the single.php file on my child theme, it dosen’t make the same result as the single.php main theme file…or I should have the same result because it’s the same file so I’m lost again 😀

    I’m sorry being annoying but I don’t have so much skills in php and I don’t want to do any bad move with files…So if you have some ideas to help me I’ll appreciate a lot!

    Thanks for your answer and your availability!

    Andy
    Andy
    Keymaster

    Hi Mickaël,

    The image has “attachment-medium” because the image you inserted is set to “Medium”, you can change this to large.

    Changing the class wouldn’t change the image on the page.

    Unfortunately you’re asking questions which are out of the scope of “Theme Support” 😉 I understand you’d like to get this done quickly but unfortunately learning all that you need may take some time.

    What exactly are you trying to achieve with the image?


    Mickaël BELLAMY
    Participant

    Hi Andy,

    It’s ok, after hours and hours of searching I finally managed to change the image class from medium to large on the media pages by adding some php code in my child theme. I don’t know how it works at all because I don’t have any php knowledge, but it displays me now the size I want to the default media pages so I won’t try to understand how ^^ If you want to know what I added to make it work:

    add_filter('prepend_attachment', 'ag_prepend_attachment');
    function ag_prepend_attachment($p) {
       return '<p>'.wp_get_attachment_link(0, 'large', false).'</p>';

    And in this code I can change the ‘large’ attribute with medium or full to display the image size I want…For now it doesn’t change anything in the other pages of my website so…let’s hope it won’t change! ^^

    I’m sorry to ask you some things that are not relevant to your support, I’ll try to not annoy you anymore with this!

    Thanks for your answer anyway 😉

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.