This worked for me:
include ('wp-blog-header.php');
and before:
while (have_posts()) : the_post();
you have to create wp_query, so do this for example:
query_posts('cat=1'); // or any other query args you wish
Related Posts:
- Different amount of posts on homepage than paged pages
- Blog post per page setting conflicting with custom WP_Query?
- How to inject a post within a loop
- query_posts different amount of posts per page [duplicate]
- Change Posts per page count
- Keep featured content post in homepage with original order
- How to get posts published between a date and today?
- How to show related posts by category
- The next_posts_link() works only with original $wp_query
- the_author() returns empty string
- Allow variable amount of comments before pagination
- Display all posts from specific categories on a page
- Skipping first 3 posts in wp query
- How to load paginated post pages via ajax
- How to disable content pagination?
- How to Group Posts by the First Letter or Number?
- How to exclude latest x posts from a paginated query?
- Display content from a specific category
- How to display posts by current user/author in a custom page template?
- post_name empty after wp_insert_post
- Query posts distinct authors
- How to get previous 10 days post from a specific date – WP Query
- Number of posts per page setting is not working?
- How can I display 7 posts on the home page, but 9 posts on the subsequent pages?
- Custom Post Type Pagination Doesn’t Work in WordPress 3.4
- Automatically create pages in a post based on number of words
- WordPress Posts Out Of Order after 3.1 Update
- Setting pagination for images attached to a post
- Pagination not working on Custom Page Template
- Query only Posts from Both of Two Category?
- Show number of posts AND number on current page
- Insert custom div between posts
- Can’t show comments count per post outside loop
- Pagination for Pages and Posts
- Programmatically inserting page breaks
- I’m having some issues with previous_post_link() and next_post_link()
- Only display posts with comments
- Order post by year DESC and month ASC
- WordPress get posts by date without query_posts
- How to Display Post View Count
- JetPack Infinite Scroll not working on custom theme
- Featured Posts for Category Pages
- Pagination – Posting First Page Content
- Load posts into sidebar and paginate via ajax?
- How can I get all posts data from within a paginated search result?
- Cannot Update A Post, 404 Error
- When paginating a Page with the tag, how can the 2nd and subsequent page styles be customised?
- A way to detect which page a post is on
- Function to show random posts from a category
- Hiding posts in a list from specified categories
- Converting multiple loops into one single loop with pagination
- pagination hook doesn’t work with search results
- how to know if the post has pagination () or not
- How would I get 1 latest post from a query for 5 posts?
- Filter Posts By Tag
- Unwanted Duplicate Posts Showing in Pagination Pages
- Can I set and show “important” post in my blog?
- posts_nav_link() not displaying anything
- can’t use the page_test method to check pagination
- Exclude posts with empty post_content in wp_query
- Is it possible to change the admin posts per page view?
- Lazy Load using WP_Query pagination
- Pagination on single post page?
- Improving WP_Query for performance when random posts are ordered
- How to display different number of posts
- Should $found_posts be returned as string in ‘found_posts’ filter hook?
- Archive Page for Custom Post Type is not Working
- Create dropdown list post
- I would like to give special promotion for the first 100 posts in my blog? Can anyone tell me how to do that?
- Getting content from a single *page* of a post
- previewing my posts on static page?
- Exclude newest post from category X but show rest
- How do I detect which page I’m on within a paginated post?
- Reset Popular post query?
- Duplicating Table of Contents for Paginated Post
- How to add pagination in between post and comments?
- Inserting custom data to the_post() during loop
- How To Get Posts With A Specific Word
- Why WP_Query(‘showposts=5’) shows only 1 post?
- is there a way to show the the post title after the image?
- Display posts with tag that matches current post title
- Why is querying posts messing up my pages?
- Display all posts that were published before full post on single.php
- Category Foreach keeps looping?
- 404 on paginated blog pages
- How to exclude latest x posts from a paginated query?
- Two loops, one AJAX loop, exclude posts in first loop from second loop, loops are in different files
- Get the number of posts shown in the current page
- Blog page pagination is not working after using the offset argument
- Custom loop pagination links not working
- How to Restrict Previous & Next Post Link to Posts of Same Category?
- Making a custom Pagination for multi page blog post
- pagination for single post by category
- 301 (static page instead latest posts)
- Random ajax load only works with posts_per_page set to -1
- How to : pagination in 3 different custom loops on the same page
- Pagination with an array of post objects?
- Display an author’s posts on his own author page
- How safe is renovating $wp_query when doing WP_Query pagination in Page Template
- Start WP Pagination From Number 1 in URL