I have been in the process of adding the link post format to the thematic theme via a child theme. To be honest, this is the first time I have done any sort of theme work with WordPress.
I have been able to change the title permalink to the link I am linking to and adding a symbol to the title so that there is a visual to someone to realize that there may be a different behavior. (Example post)
Should I be using thematic's filters to push out these changes to the theme or should I be using WordPress's? Also, how do I add a permalink in the RSS feed so people can still comment on my site (much like Daring Fireball)
I have been doing the following in functions.php:
/**
* Override the post title logic
*/
function mikewillsthematic_thematic_postheader_posttitle() {
if (has_post_format('link')) {
$posttitle = '<h2 class="entry-title"><a href="';
$posttitle .= get_post_meta( get_the_ID(), "post_format_data", true);
$posttitle .= '" title="Direct link to article" rel="bookmark">';
$posttitle .= '∞ ';
$posttitle .= get_the_title();
$posttitle .= "</a></h2>\n";
} else {
// Handle other post types.
}
return $posttitle;
}
add_filter('thematic_postheader_posttitle', 'mikewillsthematic_thematic_postheader_posttitle');
/**
* Override the RSS URL
*/
function mikewillsthematic_rss_permalink($permalink) {
global $wp_query;
if($url = get_post_meta($wp_query->post->ID, 'post_format_data', true)) {
return $url;
}
return $permalink;
}
add_filter('the_permalink_rss', 'mikewillsthematic_rss_permalink');
/**
* Override the RSS title
*/
function mikewillsthematic_rss_title($title) {
if (has_post_format('link')) {
$posttitle = '∞ ';
$posttitle .= $title;
} else
$posttitle = $title;
return $posttitle;
}
add_filter('the_title_rss', 'mikewillsthematic_rss_title');
But I feel that this seems... excessive. Is there a better way?