I'm trying to get "string of text: Edit"
<?php echo 'string of text: ' . edit_post_link( 'Edit' ); ?>
but this outputs "Edit string of text:"
How do I make it appear in the correct order? "string of text: Edit"
Use the second parameter of edit_post_link(), the before parameter:
<?php edit_post_link( 'Edit', 'string of text: ' ); ?>
edit_post_link() echos the result already. you need to use one of the following examples:
<?php echo 'string of text: ' . get_edit_post_link( 'Edit' ); ?>
or
<?php echo 'string of text: '; edit_post_link( 'Edit' ); ?>
get_edit_post_link while it must have first parameter as post_id ( interger ).