Exclude an att tag from display on attachment page site front end
-
Hi David,
A while ago you provided code which worked with an Att. tag
Gallery: term
(so for exampleGallery: nebula stars dust
). I added this tag to all the uploaded media I wanted to form a particular MLA Gallery with your code.As this was an internal type of tag I wanted to prevent it from displaying on the attachment page site front end which you updated with some revised code:
$output = array(); foreach ( $terms as $term ) { if ( 0 !== strpos( $term->name, 'Gallery:' ) ) { $output[] = sprintf( '<a href=%1$s%2$s?my_taxonomy=%3$s&my_term=%4$s title="Gallery for %5$s">%5$s</a>', $site_url, $page_path, $taxonomy, $term->slug, $term->name ); } } $output = "Tags: " . implode( ', ', $output );
The revised part being
if ( 0 !== strpos( $term->name, 'Gallery:' ) ) {
This took out the
Gallery: term
tag from display on the attachment page front end.Now I want to add some more tags to be excluded and am uncertain of the syntax, have tried for example:
if ( 0 !== strpos( $term->name, 'Gallery:', 'gallery control portrayal' ) ) {
The new tag being of course
gallery control portrayal
.No huge success so far with my own attempts, the new tag and the original Att. tag
Gallery: term
are showing up on my site.Am I somehow able to add more tags to this setup?
Thanks,
- The topic ‘Exclude an att tag from display on attachment page site front end’ is closed to new replies.