• Hi,

    Ok so using custom post types to generate staff pages for everybody I wanted a menu for the output as such:

    People:
    > Employee 1 – Position
    > Employee 2 – Position
    > Employee 3 – Position

    So, originally I was doing this with a loop and pulling out the title (which has the name) and the job position (a custom field).

    Then we realised we wanted to highlight the current page, which obviously wasn’t happening by the way i was doing it so instead i opted to use wp_list_pages to pull out all of the pages/posts in my custom post type of ‘people’ and I have that working nicely.

    However, wp_list_pages obviously just lists the title of the page which is just the employee name but we want to add their position as well, and this is where I am stumped.

    So is there a way to add inject some php (to grab the position) in to wp_list_pages, or is there a way to add the current_page class on a standard query loop?

    Thanks
    Dan

Viewing 1 replies (of 1 total)
  • You could create a ‘walker’ to modify the wp_list_pages output.

    You could also modify the loop you originally used. If you will put the code you used (the whole template, not just the loop) in a pastebin, I will take a look to see if that is easy.

Viewing 1 replies (of 1 total)
  • The topic ‘Altering wp_list_pages output (or adding current page to CPT)’ is closed to new replies.