Quantcast
Channel: WordPress.org Forums » All Posts
Viewing all articles
Browse latest Browse all 112466

smintel on "php code to change link based on title"

$
0
0

Thanks a lot - I've actually just got it working - if anyones interested this seems to be doing the job:

<?php  $tits  = get_the_title(); if ($tits == "The Living Map of La Bastide") {$add = "http://www.labastidevivante.fr\" target =\"_blank";} else{$add="http://www.samwoolf.net/mfreeth/category/".$tits;}  ?> 

			<h2><a href="<?php echo $add; ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>

I think thats basically the same as what you were telling me about echoing.. except that the the_title() function seems to have echoing built into it so once I started using get_the_title() instead it all fell into place.


Viewing all articles
Browse latest Browse all 112466

Trending Articles