Support » Plugin: Best Image Gallery & Responsive Photo Gallery - FooGallery » Use Custom URL for Image in Theme Template

  • Resolved swcomm

    (@swcomm)


    If I have images in a FooGallery that have custom URLs set, and I’m also using some of those images as a page/post Featured Image, how would I grab your custom url field along with the post_thumbnail in my templates to use those custom URL links on the images in my page and single?

    Thanks in advance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support elviiso

    (@elviiso)

    Hi @swcomm

    From your question, I do understand that you do have a FooGallery gallery containing images with URL links added to the “Custom URL” attribute of these images and some of the images have been used on other pages or posts, and what you want to implement is to have these images on the pages and post be able to open up the custom URL when they are clicked.

    Could you kindly confirm if this is what you want help with since I do not have a full understanding of your question? If this is not what you meant, kindly clarify further so that I can be able to understand your question and assist you.

    Thanks in advance and hoping to hear from you soon.

    Kind regards,
    Elvis

    Thread Starter swcomm

    (@swcomm)

    Thanks for the quick reply – yes, you understand what I’m asking perfectly. In my post/page template, if Featured Image has a FooGallery custom URL, use that link on the Featured Image.

    Plugin Author bradvin

    (@bradvin)

    The custom URL is stored in post meta for the attachment. You can access it using the key
    _foogallery_custom_url

    Example code to get it:

    
    $custom_url = get_post_meta( $attachment_id, '_foogallery_custom_url', true );
    
    Thread Starter swcomm

    (@swcomm)

    Hi – thanks! I had to grab this a slightly different way to do what I needed, but this was helpful.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.