我在PHP中生成了面包屑的文本链接,我无法弄清楚如何消除生成链接之前和之后的额外空间。这是最后的链接:
网站链接:link text
<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'), 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>
答案 0 :(得分:2)
答案 1 :(得分:0)
这是盲目的做法,但试试这个:
<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>