WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Brett2000
    Member
    Posted 1 year ago #

    Hi,

    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);
    or
    $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?

    TIA,
    -Brett

    http://wordpress.org/extend/plugins/rps-image-gallery/

  2. redpixelstudios
    Member
    Plugin Author

    Posted 1 year 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
    Member
    Plugin Author

    Posted 1 year 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

About this Topic