Home › Forums › General Issues › Category Page › Reply To: Category Page
Yes, the page breaks after the navigation at the top of the page.
Now I have this error showing up where the page breaks:
“Fatal error: Call to a member function have_posts() on a non-object in /home/senroctech/public_html/wp-content/themes/Senroc/banner-cat.php on line 66”
Here is my code where the page breaks:
<?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();
<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 endwhile;
endif; ?>
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.