$post is causing $loop = CFS()->get() to not work properly
-
This code on my static homepage displays recent posts:
<?php $postslist = get_posts('numberposts=10'); foreach ($postslist as $post) { setup_postdata($post); ?> <div class="post-wrapper"> <?php the_content(); ?> </div> <?php } ?>
…and in the next section on the page I am calling some custom fields from CFS including a loop. The above code causes the custom fields to not display their data, and I have narrowed it down to the issue being something to do with $post in the above code because when it is eliminated, the custom fields display their data properly. Here is the code for the custom fields.
<?php $loop = CFS()->get('questions'); foreach ( $loop as $row ) { ?> <div class="faq content-col"> <h6><?php echo $row['question']; ?></h6> <p><?php echo $row['intro_text']; ?></p> <?php echo $row['link']; ?> </div> <?php } ?>
Thank you in advance for your help! This forum has been AMAZING at helping with WordPress CFS.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘$post is causing $loop = CFS()->get() to not work properly’ is closed to new replies.