I have searched this problem for a while now, maybe it is simple or maybe not. I could not figure out how to get this to work.
My goal outcome would be a hyperlink related to the post meta with some styling like so.
<a href="href_link" style="color: #e67300" rel="nofollow"> Check out the r_title here!</a>
The code I have is:
<?php
$rtitle1 = get_post_meta($post->ID, 'r_title', true);
$rlink1 = get_post_meta($post->ID, 'href_link', true);
function testfunction() {
$output .= '<a href=\"'$rlink1'\" style=\"color: #e67300\" rel=\"nofollow\">';
$output .= ' Check out the '$rtitle1' here!</a>';
return $output;
}
add_shortcode('shortcode', 'testfunction');
?>