WordPress.org

Support

Support » How-To and Troubleshooting » Recent Post display

Recent Post display

  • I made a search and still couldn’t solve my problem.

    I got this error msg on my theme:

    Warning: Invalid argument supplied for foreach() in /home/catscity/domains/catscity.com.my/public_html/xu/wp-content/themes/brajeshwar-v70-1/index.php on line 43

    and the line 43 code shows this:

    <h3 class=”sec-title”>Recent articles</h3>
    <?php
    $posts = get_posts(‘numberposts=5&offset=1’);
    foreach($posts as $post) :
    setup_postdata($post);
    ?>

    why it doesn’t work?
    I am using the latest wordpress and a theme called brajeshwar.

Viewing 1 replies (of 1 total)
  • That error, on a foreach statement, likely means your $posts variable is empty.

    How many actual posts do you have?

Viewing 1 replies (of 1 total)
  • The topic ‘Recent Post display’ is closed to new replies.
Skip to toolbar