• denisschischka

    (@denisschischka)


    Hi, im kinda helpless right now. Im using the Owl Carousel Plugin and wanted to combine it with ACF. I need to have a link around a Content Slider Items to libk the whole item (Image, Headline, Teaser).

    So I created a field-group with the Field Type “Page-Link”, so I can just pick the page for the Carousel Item.

    I have already tryed so many things but eather the page was completly blank or the links were visible above the page content.

    $result .= '<a href="###MY-LINK"><div class="item">';
            if ($img_src[0])
            {
                $result .= '<div>';
                    if(!empty($meta_link)) {
                        $result .= '<a href="'. $meta_link .'">';
                    }
                    if ($lazyLoad){
                        $result .= '<img class="lazyOwl" title="' . get_the_title() . '" data-src="' . $img_src[0] . '" alt="' . get_the_title() . '"/>';
                    } else {
                        $result .= '<img title="' . get_the_title() . '" src="' . $img_src[0] . '" alt="' . get_the_title() . '"/>';
                    }
                    if(!empty($meta_link)) {
                        $result .= '</a>';
                    }
    
                    // Add image overlay with hook
                    $slide_title = get_the_title();
                    $slide_content = get_the_content();
                    $img_overlay = '<div class="owl-carousel-item-imgoverlay">';
                        $img_overlay .= '<div class="owl-carousel-item-imgtitle">' . $slide_title . '</div>';
                        $img_overlay .= '<div class="owl-carousel-item-imgcontent">' . $slide_content . '</div>';
                    $img_overlay .= '</div>';
                    $result .= apply_filters( 'owlcarousel_img_overlay', $img_overlay, $slide_title, $slide_content, $meta_link );
    
                $result .= '</div></a>';

    I dont know what to do anymore. THX.

    https://www.ads-software.com/plugins/advanced-custom-fields/

  • The topic ‘Inset Page Link form ACF into Plugins PHP Code’ is closed to new replies.