Hi, I’ve seen in one of your archived that forum that we are able to link a portfolio item directly to an external url by adding a functions.php file to child theme? It worked for the person who posted the question. I’ve just tried the same thing and it doesn’t work. Can advise? Cos it’s really very irritating to for a browser to go another step to visit the external url.
Below is what I’ve .php file I’ve copied from that forum.
add_filter( 'post_type_link', 'x_remap_portfolio_permalink_to_project_link', 10, 4);
function x_remap_portfolio_permalink_to_project_link($post_link, $post, $leavename, $sample) {
if ('x-portfolio' == $post->post_type) {
$custom = get_post_custom($post->id);
if (isset($custom['_x_portfolio_project_link']) && $custom['_x_portfolio_project_link'][0]!='')
return $custom['_x_portfolio_project_link'][0];
}
return $post_link;
}