• naoshad

    (@naoshad)


    Hello All,
    I am working on template located here:
    http://www.webguys2hire.com/wordpress/

    on “More on Us” section i used query_posts('showposts=3'); to fetch the posts. But it it behaving strange. its showing 5 post in that area.
    I wanted to exclude Our Mission from the area but didnt manage. I tried
    post__not_in’ => array(35) but that didnt work.

    Would you please help.

    Thanks,
    Naoshad.

Viewing 3 replies - 1 through 3 (of 3 total)
  • MichaelH

    (@michaelh)

    Consider using get_posts with setup_postdata.

    Example:
    http://www.daobydesign.com/blog/2007/07/modifying-wordpress-front-page/

    stvwlf

    (@stvwlf)

    Hi

    More than likely you added the query_posts to a different template file than the one that is displaying the posts.

    A good idea is to add code like this
    <!-- index.php --> at the top and code like this
    <!-- end index.php --> at the bottom of your template files.

    index.php
    single.php
    page.php
    category.php
    archive.php
    and any custom templates you’ve created.
    Obviously each file gets marked with its own filename.

    The reason is when you View Source on a page you can easily tell which template WordPress is using. Add your query_posts to that one.

    Thread Starter naoshad

    (@naoshad)

    Thanks MichaelH and stvwlf.
    For noe I have solved the data using get_posts but why query_posts(‘showposts=3’) that code block was behaving like that? I am a newbie with wordpress. so any suggestion will help me to grow!

    Thanks a lot again.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘how query_posts() works?’ is closed to new replies.