Home › Forums › General Issues › Image src blank › Reply To: Image src blank
I got it working with
add_action('generate_after_entry_title','gabster_view_logo' );
function gabster_view_logo() {
if ( function_exists( 'get_field' ) ) {
$tag = get_the_tags();
$term_id = $tag[0]->term_id;
$term = get_term( $term_id );
$image = get_field( 'view_logo', $term );
}
if (is_home() || is_archive()) {?>
<div class="view-logo"><img src="<?php echo $image; ?>" /></div>
<?php
}
}
Output
https://gyazo.com/ccf55b46b8c06416cb2d3c9cbe3cbfb4
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.