• wp.rook

    (@wordpressrook)


    Hi, I’m setting up a staff directory for a client on their WP site and I was thinking of using custom fields for this so that when they want to update their staff list they can just edit the custom field instead of messing around on the page directly?

    So is the best way to do this to set up a custom field where the keys and values are as follows:

    Key 1= Alice (picture) Value=”/images/alice.jpg”
    Key 2= Alice (contact) Value = “Alice’s phone number
    email address
    branch number”

    and so on?
    Key 3 = Bob (picture) Value = “/images/bob.jpg”
    Key 4 = Bob (contact) Value = “”Bob’s phone number
    email address
    branch”

    Or is there a better way to do this?

    Thanks for any help!

Viewing 3 replies - 1 through 3 (of 3 total)
  • It might work better to create a custom post type for Employee and have a page for each person. The custom field keys would be the same on each page so you could query the post type and loop through the posts.

    Adding, changing, and deleting an employee record would be very simple.

    The Custom Post Type UI plugin makes adding a custom post type very easy.

    Thread Starter wp.rook

    (@wordpressrook)

    I don’t mind making a page for each person but I need them all to be indexed on one page… is there a good way to do that that isn’t manually?

    Thanks for you help!!

    Just create a template that queries all of the custom post type and lists the information for each one in the loop.

    The exact code will depend on your theme. You can probably start with index.php and put in a template name and a query.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘staff directory–best way to implement custom fields?’ is closed to new replies.