admin管理员组

文章数量:1130349

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

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

本文标签: Function to list all post slugs for every post in my WP database