Link to some external ressource in post title

add this code to your functions.php file

<?php
function print_post_title() { global $post; $thePostID = $post->ID; $post_id = get_post($thePostID); $title = $post_id->post_title; $perm = get_permalink($post_id); $post_keys = array(); $post_val = array(); $post_keys = get_post_custom_keys($thePostID); if (!empty($post_keys)) { foreach ($post_keys as $pkey) { if ($pkey==’url1′ || $pkey==’title_url’ || $pkey==’url_title’) { $post_val = get_post_custom_values($pkey); } } if (empty($post_val)) { $link = $perm; } else { $link = $post_val[0]; } } else { $link = $perm; } echo ‘<h2>< a href= “‘.$link.'” rel=”bookmark” title=”‘.$title.'”>’.$title.'</h2>’; }
?>

open your index.php/home php template, replace the standard code for printing titles:

<h2 >< a href =”<?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”><?php the_title(); ?></ h2>

by a call to the new print_post_title() function:

<?php print_post_title() ?>


external link in post title