Hi bmg
Can you explain more about what you mean by “but the actual title of the post is not an active link.” Does it mean the post doesn’t have a title, or something else?
The file is correct but the code you posted is for related post thumbnails in a feed. Maybe you meant this:
$image_output = "<a href='$url' title='$post_title_attr'>$gallery_image</a>";
Thread Starter
bmg
(@bridgetg)
Sorry, I meant that the title isn’t an active link to the post, it just shows up as text. So in order to view the post, I have to click the thumbnail. I would like to be able to click both the thumbnail and the title of the story to link me to the post page.
No problem 🙂
Try it with this in your theme’s functions.php
add_filter( 'related_posts_by_taxonomy_caption', 'link_related_caption', 10, 3 );
function link_related_caption( $caption, $related, $args ) {
$caption = '<a href=' . get_permalink( $related->ID ) . '>' . $caption . '</a>';
return $caption;
}
If you need it with the post date (as in the other topic) use this:
add_filter( 'related_posts_by_taxonomy_caption', 'link_related_caption', 10, 3 );
function link_related_caption( $caption, $related, $args ) {
$date = '<span class="related-post-date">';
$date .= get_the_date( get_option( 'date_format' ), $related->ID );
$date .= '</span>';
$caption = '<a href=' . get_permalink( $related->ID ) . '>' . $date . $caption . '</a>';
return $caption;
}
http://keesiemeijer.wordpress.com/related-posts-by-taxonomy/filters/#related_posts_by_taxonomy_caption