I'm trying to get this link to look like this:
Comment on this show >> | Listen to this show >>
Where "Comment on this show >>" gets populated properly with its permalink.
"Listen to this show >>" link should be populated with that posts 'Listen Now' custom field value.
function holylandmoments_comment_link() {
return ' <a class="read-more-link" href="'. get_permalink() . '">' . __( 'Comment on this show »', 'holylandmoments-show' ) . '</a> | <a class="read-more-link" href="'. get_post_meta($post->ID, 'Audio File',true); . '">' . __( 'Listen to this episode »', 'holylandmoments' ) . '</a>';
}
Problem is I don't get the path to the custom field value of Listen Now to populate the second link... any ideas??
The custom field value is a link to an audio file. So for all posts that fall under the category shows there is a custom field named 'Audio File' the value of that field is:
http://www.mydomain.org/audio/sample.mp3
So when the excerpt is called for archive pages to display I need two links to display one that points back to the post and another that points to the MP3 file.
So in my functions.php file I have the function above and then I call it with:
function holylandmoments_custom_excerpt_more( $output ) {
if ( has_excerpt() && in_category( _x('devotionals', 'devotionals category slug', 'holylandmoments') ) &&! is_attachment() ) {
$output .= holylandmoments_read_more_link();
}
else
if ( has_excerpt() && in_category( _x('shows', 'shows category slug', 'holylandmoments') ) &&! is_attachment() ) {
$output .= holylandmoments_comment_link();
}
return $output;
}
add_filter( 'get_the_excerpt', 'holylandmoments_custom_excerpt_more' );
Thanks!
Matt