template-sitemap.php – want to output custom post type Support Forums for LiveMesh Themes & Plugins › Forums › Invent Theme Support › template-sitemap.php – want to output custom post typeTagged: post_type, sitemap This topic has 5 replies, 2 voices, and was last updated 1 year, 10 months ago by Raghavendra. Viewing 6 posts - 1 through 6 (of 6 total) Author Posts October 27, 2019 at 12:27 pm #32063 palmtreeParticipant Hi there, I would like to output staff list in the sitemap page. <?php wp_list_pages(array( 'post_type' => 'staff', 'title_li' => '' )); ?> This one did not work… Could you tell me the appropriate code? Thanks October 31, 2019 at 4:15 am #32079 RaghavendraModerator The correct should be (if you have not figured this out already) – <h2 id="staff-list"><?php echo esc_html__('Our Staff', 'invent'); ?></h2> <ul class="list1"> <?php $loop = new WP_Query(array('post_type' => 'staff', 'posts_per_page' => ' - 1')); while ($loop->have_posts()) : $loop->the_post(); ?> <li> <a href="<?php echo get_permalink(); ?>"> <?php echo get_the_title(); ?> </a> </li> <?php endwhile; ?> <?php wp_reset_postdata(); ?> </ul> October 31, 2019 at 4:24 am #32084 palmtreeParticipant Hello Raghavendra, Thanks for your reply with the code. I appreciate it a lot but the code is only outputting 1 staff…. I have 13 staffs. It would be great if you could help me to resolve this… October 31, 2019 at 4:29 am #32085 RaghavendraModerator Sure. Pls change the line $loop = new WP_Query(array('post_type' => 'staff', 'posts_per_page' => '-1')); to $loop = new WP_Query(array('post_type' => 'staff', 'posts_per_page' => -1)); October 31, 2019 at 4:31 am #32086 palmtreeParticipant AMAZING!!!!!!!!!! Now it output 13 staffs. Thank you so much!!:))))) October 31, 2019 at 4:33 am #32087 RaghavendraModerator You are welcome. Author Posts Viewing 6 posts - 1 through 6 (of 6 total) The forum ‘Invent Theme Support’ is closed to new topics and replies.