So I'm running a few ACF forms. One creates the post, and then I have an edit post form that edits the post via a form that populates based on the post id.
So my edit post url: site.com/edit-post/?post=478
Then I have some code in my file:
<?php $post_id = $_GET["post"];
This effectively lets me get the current post ID based on the ID passed in the URL. It works well for my forms.
The issue I'm having is I want to display the author name for the post in the URL, however I can't seem to find the right syntax to do it.
the_author(); and it doesn't give me the right author.
Additionally, I tried
the_author_meta( 'display_name', $post_id['post_author'] ); and it gave me a different author name but still not the right author for the post.
Any ideas as to what I could try to get this working?
Thanks, let me know if you need more info.