• Hello,

    I am trying to replace the slider custom type post with an external link with ACF field. I use the following code but not luck.

    add_action( 'dd-carousel-after-content' , 'my_custom_carousel_header' , 10, 1);
    function my_custom_carousel_header($id){
    	if ($id == 254524) { // your carousel ID - numeric
    	     global $post;
    	     echo '<div class="item-inner"><a href="'.get_field('external_link_sl', $post->ID).'">Go To Link</a></div><br>';
                 //$terms = get_the_terms($post->ID, 'product_cat'); // use your custom taxonomy
                 $term_list = array();
                 foreach ($terms as $term){
                     $term_list[] = $term->name;
                 }
            echo implode(', ', $term_list);
         }
    }
    

    How to set the a href to image link with the a href link with the ACF field link?

    The settings are Display Post Option > Image On Click Options > None – Just show image

    • This topic was modified 2 years, 5 months ago by sroskylos. Reason: better explanation
  • The topic ‘Add Image Link With ACF field’ is closed to new replies.