0

How can I convert functions like the_permalink() into strings like $permalink?

1 Answer 1

2

Use get_permalink() function which returns a value instead of printing it.

Example -

$permalink = get_permalink($id); //$id if using outside loop
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.