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
- Load more posts using AJAX based on posts inside WP_Query
- Show posts from two specific category in WP_Query
- Tax query get first product with attribute value in pre_get_posts
- custom post type and a “sticky” position taxonomy
- query hook parse_tax_query function takes no effect
- WordPress sorting posts by date and title using a dropdown
- pre_get_posts pagination not working
- How can I have sticky posts while ALSO showing posts from a specific category using one WP_Query?
- How to get max value of filtered query post
- How to create loop of posts except post ID defined via ACF field
- Duplice post with standard WP loop – fixed by using query_posts() instead
- ElasticPress is (aparently) messing with my search filters
- Pagination repeating posts on search results
- Pagination not working on archive.php template?
- Help with query_posts function
- WordPress Sub Category Archive, Show Extra Empty Page Number in Pagination
- Displaying all posts from other sites on the network on one site
- WP_query pagination on frontpage
- Pagination Not Working When Used With WP_Query() `offset` Property
- pre_user_query vs pre_get_posts
- Get posts for each user
- How do I stop the same post showing multiple times in a archive?
- Get posts that match defined arrays of tags
- Query for current post
- Multisite how to display merged posts from two sites and sort by latest date?
- Numeric pagination custom post type
- Custom query to retrieve oldest post and retrieve others with date interval
- Pagination unique to a widget
- Trying to get pagination working on WP_Query() post grid
- Use WP_query to match post types based on custom field values
- Performance considerations – postmeta table versus new table for custom posts with foreign keys?
- Ordering of posts, 2020 Year showing as next event when should be last
- Numbered Pagination Showing The Same Posts After Altering WP_Query
- Pagination inside the blog page not working
- Problems in paginate_links with custom query loop and MB-Relationships
- Pagination for Category does not work
- Order by meta date with a thousanth of a second defaults to post order
- Custom query for custom post type not getting correct post ID
- Why pagination is not working with tax_query param?
- Pagination on archive.php not working?