Home › Forums › Front-end Issues › ACF's in header.php showing everywhere but on search results page › Reply To: ACF's in header.php showing everywhere but on search results page
… actually, strike that: I was too quick with drawing conclusions.
This has nothing to do with the Jesse Heap snippet of code.
I found that if I use ACF group and use code like this to display a sub item in that group:
<?php if( have_rows('site_header', 'option') ): ?>
<?php while( have_rows('site_header', 'option') ): the_row(); ?>
<?php if(get_sub_field('phone', 'option')) : ?>
<div id="phone">
<span class="hide-on-phone hide-on-tablet"><?php the_sub_field('phone_header', 'option') ?></span>
<a href="tel:<?php the_sub_field('phone_computer', 'option') ?>"><?php the_sub_field('phone', 'option') ?></a>
</div>
<?php endif; ?>
<?php endwhile; ?>
<?php endif; ?>
… that this will not display on a search results page. A bug?
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.