Store the_permalink() as a variable

The wordpress function the_permalink() automatically echos the content to the screen.

Sometimes you want to store this value in a variable.

In this case use:


$string = get_permalink();

Leave a Reply