Hi,
I'm wondering if there's any way to remove the "|" from the beginning and end of the tags list?
For example, instead of:
Tags: | black | blue | white |
How about:
Tags: black | blue | white
Thanks,
Mark
Hi,
I'm wondering if there's any way to remove the "|" from the beginning and end of the tags list?
For example, instead of:
Tags: | black | blue | white |
How about:
Tags: black | blue | white
Thanks,
Mark
Okay, I figured out how to remove the first "|"...simple enough. But I have no idea how to remove the one at the end, since that is appended to each tag. I don't know enough PHP to create a conditional that omits it from the last one. :-(
The current theme tags
if ( $ct->tags ) :
echo '<p>'. __( 'Tags: ' );
$action_tags = array();
foreach ($ct->tags as $tag) {
$tag_link = add_query_arg( 'tag', $tag, '?page='.$_GET['page'] );
$action_tags[] = '<a href="'.$tag_link.'">'.$tag.'</a>';
}
echo implode ( ' | ', $action_tags ).'</p>';
endif;
and later in the theme list tags
if ( $tags ) :
echo '<p>'. __( 'Tags: ' );
$action_tags = array();
foreach ($tags as $tag) {
$tag_link = add_query_arg( 'tag', $tag, '?page='.$_GET['page'] );
$action_tags[] = '<a href="'.$tag_link.'">'.$tag.'</a>';
}
echo implode ( ' | ', $action_tags ).'</p>';
endif;Thanks again! It's refreshing to see a plugin that works as advertised, can easily be modified (with your help) to do additional things, and is supported actively!
Thank you for all of this.
This topic has been closed to new replies.