Support » Plugin: Rollover Themes List » [Plugin: Rollover Themes List] Remove Symbol from Beginning and End of Tags

  • 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

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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. 🙁

    Plugin Author David Sader

    (@dsader)

    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Rollover Themes List] Remove Symbol from Beginning and End of Tags’ is closed to new replies.