Home Forums Plugin Support WP User Frontend Pro Display username on woo commerce product

This topic is: not resolved

This topic contains 1 reply, has 2 voices, and was last updated by  Nayem 4 years, 7 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #29874

    colin
    Member
    Post count: 10

    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?

    #29994

    Nayem
    Moderator
    Post count: 6480

    Hello Colin,

    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(); ?>

    You may read this doc to know more details: http://codex.wordpress.org/Function_Reference/the_author

    Thank you ๐Ÿ™‚

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Display username on woo commerce product’ is closed to new replies.