Home › Forums › General Issues › Category Page › Reply To: Category Page
Hi @mccawphoto
The code:
<?php $posts = get_posts(array(
'post_type' => 'siteinfo',
'posts_per_page' => -1
));
$phone = get_field('phone_number');
if ( $posts->have_posts() ) : while ( $posts->have_posts() ) : $posts->the_post();
Is not valid.
Please read the get_posts
documenation to understand how to loop over the posts.
Perhaps you intended to use WP_Query
instead? Please research this as well.
Thanks
E
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.