"Recent posts" not working on sidebar

Discussion in 'HTML & Website Design' started by frankenstone, Nov 11, 2010.

  1. #1
    Hi guys

    I know this is kind of a noob question, but I need your help. I have this website and I accidentally removed the code for the "recent posts" widget when I cleared the sidebar of suff I didn't need. But when I used the Appearance -> Widgets feature and I added the "recent posts" thingy, it didn't work. It doesn't show anything.

    I improvised and I added a text bar for this, but keeping it would mean I'd have to add each post manually from now on.

    What code should I put into my sidebar to get the recent posts working?

    *I also should mention that the website is new and there are no recent posts. But even so, shouldn't it at least show "Recent Posts", the title of the widget?
    *the theme is this one

    Thanks
     
    frankenstone, Nov 11, 2010 IP
  2. Jerlene.net

    Jerlene.net Prominent Member

    Messages:
    11,975
    Likes Received:
    463
    Best Answers:
    1
    Trophy Points:
    385
    #2
    It won't show the menu until there is something to show under it. What does your sidebar.php file look like right now?
     
    Jerlene.net, Nov 11, 2010 IP
  3. frankenstone

    frankenstone Peon

    Messages:
    44
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    The code in the sidebar.php is this:

    <div id="sidebar">
    <ul>
    <?php /* Widgetized sidebar, if you have the plugin installed. */
    if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
    <!--
    <li>
    <?php include (TEMPLATEPATH . '/searchform.php'); ?>
    </li>
    -->
    <!-- Author information is disabled per default. Uncomment and fill in your details if you want to use it.
    <li><h2>Author</h2>
    <p>A little something about you, the author. Nothing lengthy, just an overview.</p>
    </li>
    -->

    <?php if ( is_404() || is_category() || is_day() || is_month() ||
    is_year() || is_search() || is_paged() ) {
    ?> <li>

    <?php /* If this is a 404 page */ if (is_404()) { ?>
    <?php /* If this is a category archive */ } elseif (is_category()) { ?>
    <p>You are currently browsing the archives for the <?php single_cat_title(''); ?> category.</p>

    <?php /* If this is a yearly archive */ } elseif (is_day()) { ?>
    <p>You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> blog archives
    for the day <?php the_time('l, F jS, Y'); ?>.</p>

    <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
    <p>You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> blog archives
    for <?php the_time('F, Y'); ?>.</p>

    <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
    <p>You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> blog archives
    for the year <?php the_time('Y'); ?>.</p>

    <?php /* If this is a monthly archive */ } elseif (is_search()) { ?>
    <p>You have searched the <a href="<?php echo bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> blog archives
    for <strong>'<?php the_search_query(); ?>'</strong>. If you are unable to find anything in these search results, you can try one of these links.</p>

    <?php /* If this is a monthly archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
    <p>You are currently browsing the <a href="<?php echo bloginfo('url'); ?>/"><?php echo bloginfo('name'); ?></a> blog archives.</p>

    <?php } ?>

    </li> <?php }?>



    <?php /* If this is the frontpage */ if ( is_home() || is_page() ) { ?>
    <?php wp_list_bookmarks(); ?>



    <?php } ?>

    <?php endif; ?>
    </ul>
    </div>
     
    frankenstone, Nov 11, 2010 IP
  4. frankenstone

    frankenstone Peon

    Messages:
    44
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hey you were right

    I knew it was a noob question :D

    I added the recent posts widget and made a test post, and it works. I just thought that the widget would show up even if there are no posts.

    Thanks, and I'm sorry for wasting your time with this.
     
    frankenstone, Nov 11, 2010 IP
  5. Jerlene.net

    Jerlene.net Prominent Member

    Messages:
    11,975
    Likes Received:
    463
    Best Answers:
    1
    Trophy Points:
    385
    #5
    lol No problem. Gotta start somewhere. Glad you got it "fixed".
     
    Jerlene.net, Nov 11, 2010 IP