Function to list all post slugs for every post in my WP database?

admin2025-06-05  2

Function to list all post slugs for every post in wp_posts table?

I assume there's an official function to generate a post slug, but maybe someone here already has the answer.

Function to list all post slugs for every post in wp_posts table?

I assume there's an official function to generate a post slug, but maybe someone here already has the answer.

Share Improve this question asked Jul 14, 2011 at 20:35 Jay BrunetJay Brunet 5702 gold badges8 silver badges15 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 4

example - unordered list with post slugs:

<ul>
  <?php foreach( get_posts('numberposts=-1') as $post ) { 
    echo '<li>' . $post->post_name . '</li>'; 
  } ?>
</ul>

http://codex.wordpress/Template_Tags/get_posts

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749091118a316286.html

最新回复(0)