Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

UPDATED: 5/08/2010

WordPress has now added an additional technique to display the items from a custom post-type if the post-type is set to Hierarchical.

What I would like to do though is make it so the post items have the .current_page_item class when selected in the navigation.

Does anyone know of a function to achieve this?

    <?php 
    $args = array(
      'post_type'=>'testimonials',
      'title_li'=> __('Testimonials')
    );
    wp_list_pages( $args ); 
    ?> 

Thanks, George

share|improve this question
    
Can you please leave some feedback if/why the solution in the answer by Justen is working or not for you? –  hakre Feb 5 '11 at 16:55
add comment

1 Answer 1

seen your tweet and thought i'd lend a hand, its been a while since i've coded WP - but heres my attempt: http://pastebin.com/MZiycrMe

how i go about it is,

  • get all top level pages
  • loop around each top level page checking for children
  • add all of the above into a multi dimension array
  • loop over the multi dimension array to build unordered list

i was going from the top of my head and the WP docs so there might be a bug or two, but the logic is sound..

give me a shout if you want a hand to implement it..

Justen

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.