Home › Forums › General Issues › Category Page › Reply To: Category Page
I was able to fix it!
I changed my code to:
<?php $args = array( 'posts_per_page' => -1, 'post_type' => 'siteinfo' );
$myposts = get_posts( $args );
foreach ( $myposts as $post ) : setup_postdata( $post );
$phone = get_field('phone_number'); ?>
<div class="phone">
<p><img class="phone-img" src="<?php bloginfo('template_directory'); ?>/images/phone.png" alt="<?php bloginfo('name'); ?>" /><span><?php echo $phone; ?></span></p>
</div><!--end.phone-->
<?php endforeach;
wp_reset_postdata();?>
Thanks for your help!
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.