CRED is a WordPress plugin that lets you easily build front-end forms for creating and editing content and users.
CRED User Guides include detailed documentation on creating forms, including related fields that belong to the content or the users, validating the input and displaying the forms with custom HTML styling.
When you ask for help or report issues, make sure to tell us the versions of the Toolset plugins that you have installed and activated.
Viewing 15 topics - 7,996 through 8,010 (of 11,442 total)
Problem:
I want to create a dropdown list of the users using Views
Solution:
- Create a new View
- In the Content Selection, select (Users) in front of the "This View will display:" label
- You will see the available users groups, select the role you need
- In the Loop output loop section, add the following code that will construct the DropDown list:
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<select name="selected_user">
<wpv-loop>
[wpv-conditional if="('[wpv-user field="ID"]' eq '[wpv-current-user info='id']')"]
<option value="[wpv-user field="ID"]" selected="selected">[wpv-user field="nickname"]</option>
[/wpv-conditional]
[wpv-conditional if="('[wpv-user field="ID"]' ne '[wpv-current-user info='id']')"]
<option value="[wpv-user field="ID"]" >[wpv-user field="nickname"]</option>
[/wpv-conditional]
</wpv-loop>
</select>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
[/wpv-no-items-found]
[wpv-layout-end]
- The previous code displays the users and makes the currently logged in user as the selected value