• Can you explain me, what do i wrong?
    I inserted some code in sidebar.php. I wanted to return the list of post titles in sidebar.php
    query_posts(”cat=95&posts_per_page=5″);
    while (have_posts()) : the_post();
    echo ‘‘.the_title(”,”,false).’‘;
    endwhile;

    So i become list of these 5 posts of 95 category on all pages as content, and it doesn’t matter what for a URL i requested.

Viewing 1 replies (of 1 total)
  • Thread Starter wasilevskaja

    (@wasilevskaja)

    i have found decision:
    wp_reset_query();
    this string after request in sidebar.php has solved the problem.

Viewing 1 replies (of 1 total)
  • The topic ‘how to return list of post titles in sidebar.php’ is closed to new replies.