Viewing 29 posts - 1 through 29 (of 29 total)
  • Author
    Posts
  • #210186

    I am trying to use a plugin called WP Gallery Custom Links in order to add links to images in a gallery. The plugin is supposed to override the raw file or the attachment post with the custom link but it isn’t working. The creator of the plugin suggested making sure that your theme is using the “post_gallery” filter instead of replacing it with a custom code from Kriesi.

    Can someone shed a little light onto this subject for me? Is this something that should be working or is the “post_gallery” filter something that will need to be added to the theme in the future?

    Thanks

    #210271

    Wow! I’ve been looking into this very issue this evening and have the same problem – I want to use the gallery, but need to link to pages rather than the image files. I came up with the same idea you had, based on FAQ 6 on the plugin site (http://wordpress.org/plugins/wp-gallery-custom-links/faq/). I think I’ve found the right enfold file (gallery.php), but I dont have a clue where the post_gallery filter needs to go. I’m also a little nervous about editing the theme’s core code – it would be much nicer to have the hook included in an update.

    Cheers

    rog

    #211609

    Hi!

    You can just use the regular WordPress Gallery (none of the advanced layout elements) if you are using a plugin which filters it.

    Regards,
    Devin

    #212370

    I’m having problems using the regular WordPress Gallery in this way. I would imagine it has to do with trying to use the [gallery] code in a text block so that I can use the Avia Layout Builder for the rest of the content on the page. The thumbnails don’t size up when using the [gallery size ="large"] code and the image title label that pops up above the image on hover isn’t there (probably because this is an Enfold Gallery feature and not a WordPress gallery feature).

    Also, I need to use the Avia Layout Builder because I’m not interested in having most of my pages built using the Avia Layout Builder and a few using the Default WordPress Editor. Everything needs to be consistent.

    If the “post_gallery” filter could be added in a future update, that would be great, otherwise, it looks like I’ll have to find a different solution.

    #212381

    Hi!

    You can use another filter – insert following code at the bottom of the functions.php file (child theme or parent theme):

    
    add_filter('avf_avia_builder_gallery_image_link', 'avia_change_gallery_thumbnail_link', 10, 4);
    function avia_change_gallery_thumbnail_link($link, $attachment, $atts, $meta)
    {
    $custom_url = get_post_meta($attachment->ID, '_gallery_link_url', true);
    $link = !empty($custom_url) ? $custom_url : $link;
    return $link;
    }
    

    Cheers!
    Peter

    #213795

    Sorry – its still not working – the sites back up with the revised code (thanks Peter), but the function is not calling the links. I’m still using the Wp-Gallery customer links plugin, as when I disable the plugin, there’s no option to include a custom url when adding images.

    Any ideas???

    Thanks

    rog

    #213804

    Hi!

    I debugged the code on my server and I noticed that the link data requires an array – please try this code

    
    add_filter('avf_avia_builder_gallery_image_link', 'avia_change_gallery_thumbnail_link', 10, 4);
    function avia_change_gallery_thumbnail_link($link, $attachment, $atts, $meta)
    {
        $custom_url = get_post_meta($attachment->ID, '_gallery_link_url', true);
        if(!empty($custom_url)) $link[0] = $custom_url;
        return $link;
    }
    

    Cheers!
    Peter

    #213988

    This code still doesn’t allow the plugin to work properly. The lightbox still shows up and the custom link assigned to the image is not pushing through. When I added it to the parent theme, it didn’t give me the HTML error but when I copied the functions.php file to the child theme, I got the error. Either way, the plugin still isn’t working.

    #213989

    Hi!

    It’s working on my test server and it must be a configuration issue. Please create me an admin account (post the login credentials as private reply) and post a link to your gallery page.

    Cheers!
    Peter

    #213992

    Hi Peter – If you get it working for sbrohamm, can you post the solution and I’ll try on mine, otherwise, can I post you my login???

    Cheers

    rog

    #214003

    Hey!

    Did you test the code I posted here: https://kriesi.at/support/topic/post_gallery-filter/#post-213804 ? I tested it again and it works for me. I just added a gallery element, uploaded some pics, set the url: http://www.clipular.com/c/4546260648329216.png?k=Z0vjY5c4YaE0OpYIHM2x__0tv2E , and then saved the element. Make sure you use the “small thumbnail” gallery type because the “big preview” image doesn’t support custom urls. I’ll look into it – maybe we can implement it but I’m not sure…

    Cheers!
    Peter

    #214021
    This reply has been marked as private.
    #214023

    Login credentials posted.

    I made sure that the gallery was set to small thumbnails and still no luck.

    Right now, the code above is inserted into the parent theme’s functions.php file although I’d like to be able to keep it in the child theme if possible so that I don’t lose this every time I update the theme.

    Thanks for your help Peter.

    -Justin

    #214041

    Hi!

    1) Please update your theme to version 2.4.5

    2) Please make the theme folder writable – otherwise I can’t debug the code.

    Best regards,
    Peter

    #214564

    Peter,

    I have completed the two tasks that you requested. Sorry for the delay.

    Let me know if I need to do anything else.

    Thanks again,

    -Justin

    #214570

    Hey!

    I still can’t modify the theme files. Please try to insert this code: https://kriesi.at/support/topic/post_gallery-filter/#post-213804 into your child theme functions.php file.

    Cheers!
    Peter

    #214604

    Code has been inserted into the parent theme.

    I set the permissions for the “themes”, “enfold”, and “enfold-child” folders to 777.

    Thanks,

    -Justin

    #214615
    This reply has been marked as private.
    #214622

    Peter,

    Did you intend to make your last reply private?

    Just wondering why you would need to make a reply private since you or other admins are the only one who can see it.

    If you did intend to do so, I apologize for pestering.

    Thanks,

    -Justin

    #214817

    Hey!

    Yes because I don’t want that other user can see the utl to your functions.php file :)

    Regards,
    Peter

    #219553

    HI guys – Peter – did you manage to get this working on Justin’s site?

    Cheers

    rog

    #219569

    Hey!

    No, because I couldn’t edit the file. However we should wait for the next theme update because I’m not sure why my code isn’t working and maybe some updated files are still missing in Enfold 2.4.5. The next update should contain all necessary hooks and then you can even use the “big preview” gallery style. I.e. I tested it here: http://test.inoplugs.com/agb/ and used a slightly modified version of the code I posted in one of my last posts.

    
    add_filter('avf_avia_builder_gallery_image_link', 'avia_change_gallery_thumbnail_link', 10, 4);
    function avia_change_gallery_thumbnail_link($link, $attachment, $atts, $meta)
    {
        $custom_url = get_post_meta($attachment->ID, '_gallery_link_url', true);
        if(!empty($custom_url))
        {
            $link[0] = $custom_url;
            $link['custom_link_class'] = 'aviaopeninbrowser';
        }
        return $link;
    }
    

    Best regards,
    Peter

    #219574

    Awesome! When’s 2.4.5 due for release? I must admit, you guys are great at enhancing and tweaking your existing themes – if only all developers did that!

    Cheers

    rog

    #219865

    Hey!

    Actually 2.4.5 is already available since several weeks. The 2.5 update should be ready soon.

    Best regards,
    Peter

    #225609

    Peter,

    I updated to version 2.5.2, inserted your code into my functions.php file, and still no luck. I also tried without the code inserted, no luck.

    Did you get a chance to test this plugin with version 2.5? Just wondering if this is a problem with my site or if you are having the same issues when trying to use this plugin.

    Thanks

    -Justin

    #225626

    Peter,

    After trying a few things I got the plugin to work, but not the way I was hoping.

    When I insert the custom url, it adds that on to the end of the page’s url that the gallery is inserted in instead of just linking to the custom url only. For example:

    I insert http://www.google.com into the custom url field for an image in a gallery. The gallery is inserted into www4.wmtao.com/a-gallery-test/. When viewing the page, the gallery image now has a link of: www4.wmtao.com/a-gallery-test/www.google.com

    How do I make it link to just http://www.google.com without the rest before that?

    Thanks again for your help Peter.

    -Justin

    #226071

    Hey!

    Please create me an admin account – I’ll check the configuration. When I use the login credentials here: https://kriesi.at/support/topic/post_gallery-filter/#post-214021 I just get a white screen.

    Regards,
    Peter

    #232773

    HI guys, I got it working on my site using Peter’s latest version of the function. However, I was hoping the links would work from the thumbnail as well as the main image. The url appears at the bottom of the screen, but it doesn’t click through. Any ideas???

    rog

    #232842

    Woohoo! Fixed it! All you need to do is set the ‘Use Lightbox?’ to ‘No, open the images in a browser window’ and it works!!!

    I so love this theme!

Viewing 29 posts - 1 through 29 (of 29 total)
  • The topic ‘"Post_gallery" filter?’ is closed to new replies.