I'm redecorating template mechanism of my among the wordpress wordpress plugin. Therefore the customers can personalized design according to their need. For this function. i'm asking a template format string with a few options that we can replace later.

Sample Template String :

$template = '<a href="%POST_URL%"  title="%POST_TITLE%"><img src="%POST_THUMB%" /></a>';

Code:

$temp .= $template;
$temp = str_replace("%POST_TITLE%", $ptitle, $temp);
$temp = str_replace("%POST_URL%", the_permalink(), $temp);
$temp = str_replace("%POST_THUMB%", lead_img_thumb_post($width ,$height ,$imagepath ,$icontype ), $temp);

Output:

%POST_URL%%POST_URL%%POST_URL%<a href=""  title="%POST_TITLE%"><img src="%POST_THUMB%" /></a><a href=""  title="%POST_TITLE%"><img src="%POST_THUMB%" /></a><a href=""  title="%POST_TITLE%"><img src="%POST_THUMB%" /></a>

Why %Publish_URL% is moving ahead

You should utilize get_the_permalink() rather. the_permalink() results the hyperlink towards the browser direction. While using get_whatever() rather may cause Wordpress to come back the information, rather than outputting it.