I have a text link generated in PHP for bread crumbs, and I can't figure out how to eliminate the extra space before and after the link that is generated. This is the LAST LINK:
Website link: link text
<div id="crumbs">
<a class="crumbs" href="http://www.myorphan.com/index.htm">HOME&开发者_Go百科lt;/a>//<a class="crumbs"
href="http://www.myorphan.com/blog/">BLOG</a>//<a class="crumbs caps"><?php if ( is_day() ) : ?>
<?php printf( __('Daily Archives: <span>%s</span>', 'twentyten'), get_the_date()); ?>
<?php elseif ( is_month() ) : ?>
<?php printf(__('Monthly Archives: <span>%s</span>', 'twentyten'), get_the_date('F Y')); ?>
<?php elseif ( is_year() ) : ?>
<?php printf( __('Yearly Archives: <span>%s</span>', 'twentyten'), get_the_date('Y')); ?>
<?php else : ?>
<?php _e('Blog Archives', 'twentyten'); ?>
<?php endif; ?>
</a>//</div>
trim($mystring)
This is the blind way of doing it, but try this:
<div id="crumbs">
<a class="crumbs" href="http://www.myorphan.com/index.htm">HOME</a>//<a class="crumbs"
href="http://www.myorphan.com/blog/">BLOG</a>//<a class="crumbs caps"><?php if ( is_day() ) : ?>
<?php printf( __('Daily Archives: <span>%s</span>', 'twentyten'), trim(get_the_date())); ?>
<?php elseif ( is_month() ) : ?>
<?php printf(__('Monthly Archives: <span>%s</span>', 'twentyten'), trim(get_the_date('F Y'))); ?>
<?php elseif ( is_year() ) : ?>
<?php printf( __('Yearly Archives: <span>%s</span>', 'twentyten'), trim(get_the_date('Y'))); ?>
<?php else : ?>
<?php _e('Blog Archives', 'twentyten'); ?>
<?php endif; ?>
</a>//</div>
精彩评论