I have created a form for users to be able to create their own product postings. What I would like to do is automatically add the username to the product of whoever created it, so you can see who is offering the product and view their page. In woo commerce, I have declared a product attribute as username, and it shows up on the form editor.
But it only shows up as something the creator must input. how can I make it so it is automatically generated by whoevere created the product?
Showing the author name or the the username who created the post or product is a built in feature of WordPress. If your theme has the feature to show the name of the author, then it should happen automatically. If not, then you have to
custom code it on your theme.
Just use this line where you want to show the author name. <?php the_author(); ?>