How do I add this variable to this code?
You don't have to use $website_url after all. This is the part of the expand_ratings_template function that you want to edit.
if (strpos($template, '%POST_URL%') !== false) { $post_link = get_permalink($post_id); $value = str_replace("%POST_URL%", $post_link, $value); }
Shall become:
if (strpos($template, '%POST_URL%') !== false) { $custom = get_post_custom($post_id); $post_link = $custom["website_url"][0]; $value = str_replace("%POST_URL%", $post_link, $value); }
Hopefully that works. If not, insert a
print_r($custom);
after the line
$custom = get_post_custom($post_id);
and post the content here!