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 you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.