Huh, they are not really valid tag slugs either – using uppercase is a bad practice. Anyway, I would change the array structure to check posts against to associative 'slug' => 'Name', form. Then when you foreach through the array, use this form: foreach( $find_tags as $slug => $name )
Then your anchor string becomes "<a href='http://example.com/tag/$slug/'>$name</a>"
Thanks for your answer. But I asked the wrong question. I am very sorry. I need not slug. I need show name of tag.
For eg slug name:
array( ‘actress’, ‘model’, ‘singer’ );
Must show me titles for each tags (for eg):
Best actress
Successful models
The most gifted singer
Must show me titles for each tags (for eg):
<a href='http://example.com/tag/actress/'>Best actress</a><br />
<a href='http://example.com/tag/model/'>Successful models</a><br />
<a href='http://example.com/tag/singer/'>The most gifted singer</a>
I understood what you wanted the first time, but you’re not seeing how my answer will actually work for you even though you’ve rephrased the question. Don’t worry, no problem, I’ll rephrase my answer and maybe you will then understand.
The thing is you need both a slug and a name for the output you desire. You must have a slug in the permalink, but slugs are ugly for link text, so you want the more attractive name. Thus you need to define an array that provides both types of data. There are a few ways to do this, I suggest this:
$find_tags = array(
'actress' => 'Best actress',
'model' => 'Successful models',
'singer' => 'The most gifted singer',
);
Using this method, the link text does not actually need to be the tag name, it can be any string you like. The actual name is fine though. You could also write additional code to get the name from the DB based on the slug, but since the slug array is hardcoded, it’s easy enough to hardcode the names as well.
Then alter the related part of your code like so:
foreach( $find_tags as $slug => $name ) :
if( has_tag( $slug ) )
$found_tag[] = "<a href='http://example.com/tag/$slug/'>$name</a>";
I suspect you not seeing how this will work for you is just because you’re unfamiliar with coding this type of array structure. Study carefully my suggested changes, temporarily echo or print_r the various variables involved until you understand how this type of structure works. It is a very useful thing to know.
You are right I don’t understood first time. I am very grateful for your help. You really very help me! Many-many thanks!
You’re welcome! Your misunderstanding was my doing – I didn’t explain thoroughly enough the first time out of laziness, my bad.