Title: the_permalink
Last modified: August 18, 2016

---

# the_permalink

 *  [niemi](https://wordpress.org/support/users/niemi/)
 * (@niemi)
 * [19 years, 7 months ago](https://wordpress.org/support/topic/the_permalink/)
 * Hello guys!
 * I’m working on a project and I really need your help on this one. The achieve
   on any standard wordpress site shows all posts under a date. Now what can I do
   if i want it to show everything for only one specific category?
 * If you see my site at [http://www.kreativpotens.dk](http://www.kreativpotens.dk)
   u’ll notice that my theme shows a list of all post at the bottom-right. I want
   it to show ONLY all posts posted under this specific category [http://www.kreativpotens.dk/?cat=2](http://www.kreativpotens.dk/?cat=2)
 * If i look in the sidebar.php this is the line i want to modify:
 * <?php the_permalink() ?>”>
 * I suppose the_permalink has to be changed to something else, just don’t know 
   what to write.
 * Can you help me?

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [dannybcastillo](https://wordpress.org/support/users/dannybcastillo/)
 * (@dannybcastillo)
 * [19 years, 7 months ago](https://wordpress.org/support/topic/the_permalink/#post-477288)
 * `<ul>
    <?php $myposts = get_posts('numberposts=5&category=1'); foreach($myposts
   as $post) : ?> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></
   a> --- <?php the_excerpt(); ?></li> <?php endforeach; ?> </ul>
 * Try this,
 *  [dannybcastillo](https://wordpress.org/support/users/dannybcastillo/)
 * (@dannybcastillo)
 * [19 years, 7 months ago](https://wordpress.org/support/topic/the_permalink/#post-477290)
 * BTW, you can read more here.
    [http://codex.wordpress.org/Template_Tags/get_posts](http://codex.wordpress.org/Template_Tags/get_posts)
 *  Thread Starter [niemi](https://wordpress.org/support/users/niemi/)
 * (@niemi)
 * [19 years, 7 months ago](https://wordpress.org/support/topic/the_permalink/#post-477295)
 * Thank you very much Danny!
 * I forgot to say that i would like it to show only the Title of the posts, if 
   I do it your way then it shows the whole post, which is kinda too much 😀
 * What should i change to only show the title?
 *  [dannybcastillo](https://wordpress.org/support/users/dannybcastillo/)
 * (@dannybcastillo)
 * [19 years, 7 months ago](https://wordpress.org/support/topic/the_permalink/#post-477375)
 * `--- <?php the_excerpt(); ?>`
    just remove this from the code above. that should
   only show the title.
 *  Thread Starter [niemi](https://wordpress.org/support/users/niemi/)
 * (@niemi)
 * [19 years, 7 months ago](https://wordpress.org/support/topic/the_permalink/#post-477398)
 * Thank you Danny, truly you are the man of the night!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘the_permalink’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 2 participants
 * Last reply from: [niemi](https://wordpress.org/support/users/niemi/)
 * Last activity: [19 years, 7 months ago](https://wordpress.org/support/topic/the_permalink/#post-477398)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
