How to show all permalinks of wordpress?

I want to show all current permalinks of my wordpress posts in just one page. I don’t want to use archives. I use database to do this, but its showing only guid links.

Means I want to make list like this:

Read More

http://www. mywebsite. com/category/post1
http://www. mywebsite. com/category/post1
http://www. mywebsite. com/category/post1

but what I am getting from database is:

http://www. mywebsite. com/?p=1
http://www. mywebsite. com/?p=2
http://www. mywebsite. com/?p=3

Please help me

Related posts

Leave a Reply

2 comments

  1. try this

    <?php 
     $args = array('post_type' => 'post', 'posts_per_page' => -1 ); 
     $loop = new WP_Query($args); 
     if( $loop->have_posts() ): 
         while( $loop->have_posts() ): 
             $loop->the_post(); 
             global $post; 
             echo get_permalink($post->ID);
         endwhile; 
     endif; 
     wp_reset_query();
    ?>
    

    set your permalink settings to postname first.

    Have fun 🙂

  2. You need to set your permalinks to custom structure with this ‘/%postname%/’, without the quotes.

    and then do something like this

    <a href="<?php echo get_permalink( 268 ); ?>">My link to a post or page</a>
    

    where 268 is your post id

    Use the loop to get the post ids.
    http://codex.wordpress.org/Template_Tags/get_posts

    If you have moved your application recently, then make sure you have the permalinks settings tab opened and checked once.