Hi there,
I have managed to link portfolio items directly to an external link (essentially changing the permalink) using some code that was plugged straight into the x-child theme’s function.php file, and then add a custom field using ‘x_custom_link’. The code used was:
add_filter( ‘post_type_link’, ‘x_remap_portfolio_to_page’, 10, 4);
function x_remap_portfolio_to_page($post_link, $post, $leavename, $sample) {
if ('x-portfolio' == $post->post_type) {
$custom = get_post_custom($post->id);
if (isset($custom['x_custom_link']) && $custom['x_custom_link'][0]!='')
return $custom['x_custom_link'][0];
}
I want to do the same thing with posts. Do you know how I would change/add code to enable posts as well as portfolio items?
Thanks for your help!!!