WordPress.org

Ready to get started?Download WordPress

Forums

Sidebar not working (5 posts)

  1. davidkynan
    Member
    Posted 4 years ago #

    Hi,

    My sidebar for the theme New Balance of Blue is not showing at all. Php is below. Any ideas what needs to be there so it works?

    </div>

    <div class="widget">

      <?php $postslist = get_posts('numberposts=10');
      foreach ($postslist as $post) :
      setup_postdata($post);
      ?>

    • "><?php the_title(); ?>
    • <?php endforeach; ?>

    </div>

    <?php if ( !function_exists('dynamic_sidebar')
    || !dynamic_sidebar(1) ) : ?>

    <?php endif; ?>

    </div><!--/sidebar-->

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    Please post code snippets between backticks (`). Or use the WordPress pastebin and post the pastebin url here. It makes life easier for everyone.

  3. davidkynan
    Member
    Posted 4 years ago #

    Like this:

    </div>
    
    <div class="widget">
    
    <?php $postslist = get_posts('numberposts=10');
    foreach ($postslist as $post) :
    setup_postdata($post);
    ?>
    
    "><?php the_title(); ?>
    <?php endforeach; ?>
    
    </div>
    
    <?php if ( !function_exists('dynamic_sidebar')
    || !dynamic_sidebar(1) ) : ?>
    
    <?php endif; ?>
    
    </div><!--/sidebar-->

    ?

  4. alchymyth
    The Sweeper & Moderator
    Posted 4 years ago #

    is that something new?
    on the front page?
    on single posts?
    in the archives?
    if in some these cases, it could be because of one of the latest posts.
    you could try and set them back to draft in the dashboard, and see if this changes something.
    it might also help here if you could post a link to your site.

    edit:
    if the your posted code is fully what you have left as sidebar.php - then it is corrupted.
    reupload a new copy of sidebar.php.

  5. Samuel B
    moderator
    Posted 4 years ago #

    if you fixed most of your errors, it would likely fix it

Topic Closed

This topic has been closed to new replies.

About this Topic