Altering wp_list_pages output (or adding current page to CPT)
-
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 – PositionSo, 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
- The topic ‘Altering wp_list_pages output (or adding current page to CPT)’ is closed to new replies.