• Hi,

    I’m working on an intranet site for my company. I’d like to build a staff directory (frontend) that displays (standard and custom) fields of our staff members’ user profiles (e.g. avatar photo, name, phone number, room number, office hours) . Also, I need a possibility to display these staff member details in groups (such as “A-C”, “D-F”, etc. and “department A”, “department B”). Within a group the member details should be sorted by last name.

    Is that possible with your plugin?

    cityfox

    https://ww.wp.xz.cn/plugins/custom-content-shortcode/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Eliot Akira

    (@miyarakira)

    Hello,

    ..build a staff directory that displays standard and custom fields of our staff members’ user profiles, e.g. avatar photo, name, phone number, room number, office hours

    Yes, this should be possible with the plugin, using the [users] loop. You can install the plugin and take a look at the reference pages, under Settings -> Custom Content.

    display these staff member details in groups (such as “A-C”, “D-F”, etc. and “department A”, “department B”)

    This would be easier if the users were a custom post type. The users loop doesn’t provide as good of a query capability as the posts loop, both in native WordPress function get_users and also in the shortcode implementation in this plugin.

    That said, I think it’s possible to achieve what you need with field queries, to group users with custom field values within a certain range.

    I’ll have to extend the [users] loop a little more, to meet your needs. Currently, only two field queries at a time are supported, unlike the posts loop which supports up to 5. Also, to group users whose field values start with a range of letters, i.e. A-C. This function exists in the posts loop, but not in the users loop yet.

    Within a group the member details should be sorted by last name

    The users loop has an orderby parameter, with which you can sort users according to field value. I’m looking at the code, and I see some room for improvement here, especially if you need to have two (or more) field queries as well as order by another field.

    So, I recommend trying out the [users] loop to see how it works currently, and I can work with your feedback to extend it.

    Plugin Author Eliot Akira

    (@miyarakira)

    I should add that this plugin only handles the display of content. To create content structure such as adding new user fields, you’ll have to use another plugin such as Cimy User Extra Fields.

    Hi Akira,

    I use your very very very useful plugin for display users in this way:

    [ Moderator note: code fixed. Please wrap code in the backtick character or use the code button. ]

    <table>
     <tr>
        <th>User</th><th>Email</th>
      </tr>
    [users role=subscriber]
    <tr>
       <td>[user field_name="user_ime"]</td><td>[user email]</td>
    </tr>
    [/users]
    </table>

    Any suggestion for use this plugin for display users in something like this:

    <table>
     <tr>
        <th>Korisnik</th><th>Email</th>
      </tr>
    [users role=subscriber paged=25]
    <tr>
       <td>[user field_name="user_ime"]</td><td>[user email]</td>
    </tr>
    [/users]
    </table>
    Page [users-now] of [users-total]
    [users prev_next=true show_all=false]

    Thank’s for your time,

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘fronted user list based with user meta fields’ is closed to new replies.