If enabled on the form, the author/name field is added as a Custom Field to the submitted post. You can get the name Custom Field and display it using the following code:
<?php // display submitted author name
$usp_author = get_post_meta(get_the_ID(), 'user_submit_name', true);
echo $usp_author; ?>
You can add that to your theme template and it will display the submitted name.
It worked perfectly!
I’ve added a condition so that I will post the submitted author name or the wordpress author:
if($this_post->is_submission == true)
Thank you!
Awesome!
Also note that USP provides a built-in function to check if it’s a submitted post:
usp_is_public_submission()
More info in the plugin documentation.
«You can add that to your theme template and it will display the submitted name.»
I’m a beginner in all this. Where do I have to add the code exactly ?
What I want to do: I would like to add a search tool by user submitted name.
Possible ?
Thanks
-
This reply was modified 6 years, 11 months ago by jocedage.
You would use that tag wherever it is required, most likely in some conditional logic within the WordPress Loop. I’m sure that you or your developer could build a search tool, but it’s not something that is included with the plugin.