get_the_title and get_permalink outside of the Loop July 23, 2022 by Tarik Billa use echo right before functions. echo get_permalink($ancestorsID[0]); echo get_the_title($ancestorsID[0]);