You can replace the code with something like this
<?php
global $wp_query;
$limit = get_option('posts_per_page');
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts(array('posts_per_page'=>$limit,'paged'=>$paged,'category_name'=>'albertsons, carrs, dominicks, genuardis, heb, kroger, pavillions, publix, randalls,safeway,shop-rite,tom-thumb,vons,whole-foods'));
/* you may want to uncomment the below two lines if you are using custom page template*/
//$wp_query->is_archive = true;
//$wp_query->is_home = false;
then call normal Post Loop like
if(have_posts()):
while(have_posts()):the_post();
the_content() ;//or so on
endwhile;
endif;
Btw, I will advice going against query_posts/get_posts and use WP_Query
Hope that helps to get you started 🙂
Related Posts:
- Using ajax with paging and a custom sub-query
- Custom loops, sticky posts, and pagination nightmare
- How to Get All Posts with any post status?
- How can i get count from query post
- query_post by title?
- Custom post type archive 404’s with paginate_links
- Custom Taxonomy not working with posts_per_page in new WP_query (pagination problem)
- How to set posts per page using WP_Query()
- Get the number of posts from the current page results
- query_posts() in function makes global $wp_query out of sync?
- Problem with ‘post__not_in’
- Sort posts alphabetically by custom field value, insert divider between different letters
- Is it better practice to use query_posts, WP_Query, or get_posts to create various custom loops within a Page?
- Custom Post Type “Event”: chronological list of recurring events
- Pagination on archive.php page
- Having trouble generating pagination links on custom query
- query_posts and pagination, still stuck after much research
- Total Count of Posts NOT in Selected Categories?
- how could I get the pagination as I want to when query posts using get_posts function
- pagination in author.php template returns 404 error
- How do i paginate query_posts with numeric pagination?
- Too many posts cause slow load when paginating
- Pagination on custom query
- Custom posts per page does not work with pagination
- Order posts using a custom array
- Tricky WP Query
- WP Pagination on Posts Search Results Page resulting from AJAX WP Query
- Five posts from a category in footer
- Search breaks when querying main loop for category
- WordPress pagination with get_posts?
- Blog post per page setting conflicting with custom WP_Query?
- pagination not working for category.php (custom post types in categories)
- Querying posts only if the current page is not paged?
- Pagination on category.php and tag.php not working
- query_posts pagination will always show identical content
- Can’t get pagination to work for sticky posts only
- How do I use pagination in WordPress?
- Remove Post if Advanced Custom Field is checked to fix paging
- Paginate pages with dynamic query
- Pagination linking to first page
- filter posts by meta key with pagination
- Trouble Making WP_Query paged
- odd behaviours from template tags
- Having an issue doing a WP_Query with post_content and category__and
- Custom query looking at multiple custom fields and properly sorting
- Pre-existing arguments when using queries
- Modify main loop query for paged and meta key
- Custom post type blog pagination conflict
- Post Filter clearing on pagination $_post
- get_next_posts_link() stops displaying at page 4
- send user to first page of results when reposting to page?
- How to refine WP-Query with further criteria
- Run second query on page based on author of the first query
- WordPress loop problem: Multiple loops, index.php and is_paged causing duplicate posts on next page
- Query Posts (post meta)
- Achieving pagination with `query_posts`
- Pagination in category.php not functioning
- query_posts different amount of posts per page [duplicate]
- Show number of posts AND number on current page (cannot make it work)
- /page/2/ redirect to 404
- Wp get all the sub pages of the parent using wp query
- paginate_links ignore my format
- Help to condense/optimize some working code
- Skipping first 3 posts in wp query
- Get posts by meta data OR title
- Display Posts by modifying the where clause only for my query
- Pagination causes error 404 when used with front-page.php
- Use union/intersection query_posts variables in uri request parameter form?
- query_posts doesn’t order by title
- Add custom search results to main WP search [duplicate]
- How can I pick a single post from the latest 3?
- Sorting multiple custom post types without a meta key/value pair by sort order
- Pagination on a custom post type loop
- Multiple loops without repeating content
- Possible to display posts containing a short code ?
- How to run a SQL Query for character in Post Titles
- Authors List page : how to exclude posts from certain category
- Display custom tags on pages that have a specific page parent
- How can I override one post and make it display content for another post?
- How to create query to get top 3 sticky/latest posts
- How to Show Comment Count on Related Posts?
- On what hook can I get the queried object’s final state?
- How to use ‘WP_Query’ or ‘query_posts’ to display content in a descending order
- Make query_post category name dynamic
- How can I list posts with different formats depending on order?
- query_posts orderby postmeta [closed]
- View Achive with Category Filter, but Page per post not working
- Magazine style frontpage with multiple categories/loops and no duplicate posts
- Previous / Next Links For Custom Post Type Sorted By Meta_Value
- Custom Query: Multiple CPTs and a taxonomy filter
- How to put orderby on a custom field in query_posts
- Filter posts by current date ( WP Post Carousel )
- custom query – offset to pagination
- display news with pictures 3 small and one large (loop)
- When should you use WP_Query vs query_posts() vs get_posts()?
- Can’t get pagination to work with this WP_Query loop
- Pagination in custom loop [duplicate]
- get contents and permalink from a specified page
- Limiting the amount of posts this displays
- How to remove post duplicate when using query_posts(‘offset=1’)