Use get_permalink()
function which returns a value instead of printing it.
Example –
$permalink = get_permalink($id); //$id if using outside loop
Use get_permalink()
function which returns a value instead of printing it.
Example –
$permalink = get_permalink($id); //$id if using outside loop