Deprecated: Assigning the return value of new by reference is deprecated in /home/planetjoe/domains/2097racing.com/public_html/wordpress/wp-settings.php on line 267

Deprecated: Assigning the return value of new by reference is deprecated in /home/planetjoe/domains/2097racing.com/public_html/wordpress/wp-settings.php on line 269

Deprecated: Assigning the return value of new by reference is deprecated in /home/planetjoe/domains/2097racing.com/public_html/wordpress/wp-settings.php on line 270

Deprecated: Assigning the return value of new by reference is deprecated in /home/planetjoe/domains/2097racing.com/public_html/wordpress/wp-settings.php on line 287

Deprecated: Assigning the return value of new by reference is deprecated in /home/planetjoe/domains/2097racing.com/public_html/wordpress/wp-includes/cache.php on line 36

Deprecated: Assigning the return value of new by reference is deprecated in /home/planetjoe/domains/2097racing.com/public_html/wordpress/wp-includes/query.php on line 21

Deprecated: Assigning the return value of new by reference is deprecated in /home/planetjoe/domains/2097racing.com/public_html/wordpress/wp-includes/theme.php on line 540
2097 Test Drive » Fixed error in tag listing.


Fixed error in tag listing. March 7, 2008

Just fixed an error in a foreach() call in the new jwr_show_tags() function in Squible’s wp_cats_as_tags(). Turns out that, for unknown reasons, the old implementation would barf when it saw a post without any tags, when get_the_tags() returned an empty list. Thanks to the examples described here, I’m using an if() to bail out of the function:

if (empty($posttags)) echo "";
else
foreach

The old way to do this was to throw a break at the end of the function using an if() to check the size of the list:

if ( $displaycount == $limit) {break;}

Anyway, it works now.

Article printed from 2097 Test Drive: http://www.2097racing.com/wordpress
URL to article: http://www.2097racing.com/wordpress/2008/03/07/fixed-error-in-tag-listing/

Post Tags
Conversation
Related Tags
Comments
Trackback


Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/planetjoe/domains/2097racing.com/public_html/wordpress/wp-settings.php:267) in /home/planetjoe/domains/2097racing.com/public_html/wordpress/wp-content/themes/squible/comments.php on line 20

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/planetjoe/domains/2097racing.com/public_html/wordpress/wp-settings.php:267) in /home/planetjoe/domains/2097racing.com/public_html/wordpress/wp-content/themes/squible/comments.php on line 20

Leave a Reply

This entry was posted on Friday, March 7th, 2008 at 6:18 pm. You can follow any responses to this entry through the RSS 2.0 feed. If you're wondering how to get your own icon next to your comment, go visit gravatar.com and get yourself hooked up.
2097 Test Drive is proudly powered by Wordpress 2.3.3 and Squible Beta 2.
All content is copyrighted by its author[s].