PDA

View Full Version : Empty list item - Wordpress PHP



Allyria
08-25-2008, 07:04 PM
Hello all,

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




<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?

Ebiz
10-23-2008, 10:35 PM
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