• Hi,

    I have a number of pages for staff members in my WP installation and each of these has additional custom fields for telephone, email, fax, a class room number.

    I need to create a directory listing page which will pull all the custom fields from these pages depending on the department they are in.

    The custom fields on my Staff Details page is working superbly but now I need a way to extract all that information to create a list for all the departments please.

    Many thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter sixfootjames

    (@sixfootjames)

    It seems there is no categories associated with pages specifically. Is there any other way to loop through all the staff pages and know what department they might be in?

    Thread Starter sixfootjames

    (@sixfootjames)

    I am then assuming there must be a way to loop through sub pages and fetch all custom fields in those pages?

    Thread Starter sixfootjames

    (@sixfootjames)

    Anyone able to help with this please?

    Hi sixfootjames, was encountering a similar problem and came across your posts. Here a link that helped me around my problem: https://codex.www.ads-software.com/Class_Reference/WP_Query#Custom_Field_Parameters.

    My take is the staff members should be posts, different departments should be different categories, Directory should remain a page, and custom fields for telephone, email, fax, a class room number are fine. So when you open your Directory listings page it lists only the staff in a particular department and using meta_query you can filter using your Custom Fields.

    Hope I was of some help ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to loop through custom fields for a staff directory list’ is closed to new replies.