RPS Image Gallery
[resolved] Pulling in Gallery Link URL for external use? (3 posts)

  1. Brett2000
    Posted 2 years ago #


    Your plugin is very useful, however I've got a theme using FlexSlider, instead of Gallery on my posts using a custom post type.

    That's all good, but I'm not sure how to get Gallery Link URL for an attachment inside of the custom post code, can you tell me how I would do that?

    Here is what I tried:
    $full_img_url = get_attachment_link($attachment->ID);
    $full_img_url = get_gallery_link_target ($attachment->ID);

    Neither of those will return the link and with the second, I get this error:
    Fatal error: Call to undefined function get_gallery_link_target() in /home/mywebsite/public_html/customblog/wp-content/themes/myphototheme/single-photo.php on line 49

    Can you tell me how I would get the Gallery Link URL from inside of custom post code?



  2. redpixelstudios
    Plugin Author

    Posted 2 years ago #

    No problem Brett. RPS Image Gallery is a class, so you need to access its methods (functions) slightly differently. In order to get the Gallery Link URL for a specific attachment, you would need to use:

    $full_image_url = RPS_Image_Gallery::get_gallery_link( $attachment->ID );

    You can do something similar to access the target by calling its method like so:

    $full_image_url_target = RPS_Image_Gallery::get_gallery_link_target( $attachment->ID );

    Of course you can echo the result or set the variable names to whatever you wish. We hope that this addresses your question. Let us know how it works out for you. Thanks for using RPS Image Gallery.

  3. redpixelstudios
    Plugin Author

    Posted 2 years ago #

    We are going to go ahead and mark this as resolved since the recommended solution has been tested. Please let us know if you need any additional information.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • RPS Image Gallery
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic