views:

11

answers:

1

Hello,

I need to display all my post titles in the sidebar of my Wordpress theme all the time. Just now it works only when I am browsing a category (it shows all post titles from that category). But when I click on a post, only this post title remains into my sidebar, which is not supposed to function like that.

Could you help me, please?

Thank you very much in advance! Hristo

+1  A: 

If you are able to write a plugin yourself, which is quite easy using the API of WordPress, you can make yourself a widget that uses the the_loop() function to print out all post titles.

If you have made your own theme, you can even integrate it into your functions.php file and then output the title within your sidebar template.

To query the post from the database you will need the query_posts() function, where you can also filter on some fields of your posts.

Kau-Boy
Yes, I already knew that. The problem was that once I modified the contents of the sidebar using query_posts(), it would affect the index.php as well and mess the things up.Now I use wp_reset_query() just in front of the main code in my index.php template, and everything works fine.Thank you very much for the response!
Hristo