Results 1 to 2 of 2

Thread: Empty list item - Wordpress PHP

  1. #1
    Join Date
    Nov 2007
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Empty list item - Wordpress PHP

    Hello all,

    I'm following a guide to create my own Wordpress theme, it includes this code as the sidebar:


    PHP Code:
        <li>
          <?php /* If this is a category archive */ if (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 echo get_settings('siteurl'); ?>"><?php echo bloginfo('name'); ?></a> weblog 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 echo get_settings('siteurl'); ?>"><?php echo bloginfo('name'); ?></a> weblog 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 echo get_settings('siteurl'); ?>"><?php echo bloginfo('name'); ?></a> weblog 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 get_settings('siteurl'); ?>"><?php echo bloginfo('name'); ?></a> weblog archives
          for <strong>'<?php echo wp_specialchars($s); ?>'</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 get_settings('siteurl'); ?>"><?php echo bloginfo('name'); ?></a> weblog archives.</p>
          <?php ?>
        </li>
    If none of the statements are true it comes up with an empty list item, just a bullet point on its own, which looks really messy. How do I correct this?

  2. #2
    Join Date
    Oct 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Allyria View Post
    Hello all,

    If none of the statements are true it comes up with an empty list item, just a bullet point on its own, which looks really messy. How do I correct this?

    You could 'turn off' the bullet points using CSS.

    That would not resolve any underlying fault in the PHP, but it would get rid of the bullet point.

    In the Style sheet you'd have ul {list-style:none;}

    Ebiz

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •