Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #12570

    Hi,

    I’d like to know how to get the URL of the link in the first of featured image.

    i.e. the user has selected to link to a page or custom URL using your featured image widget. I want that URL

    thanks in advance

    #75951

    Dear Corona team, I’m waiting for your suggestion to solve this problem.

    thanks

    #75952

    Hi!

    You can get the slide link with following code:

    $slides = avia_post_meta(get_the_ID(), 'slideshow');
    $link = $slides[0]['slideshow_link'];

    You can then echo $link somewhere :)

    Regards,

    Peter

    #75953

    Thanks for your suggestion

    I have addition information to suggest:

    $slides[0] — will return the type of ‘link’ you selected from the drop down slide menu (a green box)

    to get its link you must use $slides[0] or $slides[0] depend on which type does the user selected.

    To get life easier, I use “switch” Here is an example:

    Code:
    $slide_set = avia_post_meta($pageid, ‘slideshow’);

    //GET URL OF THE FIRST SLIDE SHOW

    $linktype = $slide_set[0][‘slideshow_link’];
    $linkslide = “”;

    switch($linktype) {
    case “url”: $linkslide = $slide_set[0][‘slideshow_link_url’];
    break;

    case “page”: $linkslide = get_page_link($slide_set[0][‘slideshow_link_page’]);
    break;

    default: $linkslide = “#”;
    }

    //print_r (array_keys($slide_set[0])); // DISPLY ALL KEYS IN ARRAY #debug
    $result .= ““;

    #75954

    Hi!

    Thanks for the hint. I’m sure it will help other users too.

    Best regards,

    Peter

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

The topic ‘Get URL link of first featured image’ is closed to new replies.