Your solution here is most correct..
if(have_posts()){ $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts($query_string . "&cat=4");
while(have_posts()){
the_post(); global $more; $more = 0;
…but has some errors. Try:
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$category = get_category_by_slug('your-category-slug');
query_posts(array('paged' => $paged, 'cat' => $category->term_id));
while(have_posts()){
the_post();
global $more;
$more = 0;
//output here
}
Note, that using the category id directly isn’t going to work on WP VIP. Category ID’s won’t match what you have locally.
Related Posts:
- Adding Pagination on a Custom Author Page
- Custom query pagination with php parameter as arg problem
- WordPress Paginate $wpdb->get_results
- how to override woocommerce specific loop or archive-product.php [closed]
- How can I create an alternative home page?
- How do I prevent one of two multiple loops from repeating on a second page?
- pagination in woocommerce order history page
- Broken pagination
- Search results with custom loop don’t update when paged
- Pagination Not working on Home Page with 2 Query
- Custom Loop Pagination on WordPress
- Multiple Queries and Excluding Repeating Posts?
- Last post is not showing up
- get_option issues
- Show post page only if the user has bought a specific product
- Exclude custom taxonomy tag from loop
- Paginate Author’s Post List on Custom Author Page (ANOTHER THEORY)
- Loop through custom fields with similar label / common chars in label
- CPT Loop with ACF and passing ID between Loops
- How can I display a PHP foreach loop’s answers by AJAX
- Hide text if not homepage
- Is there a way to by-pass the pagination function on one custom template?
- website with pretty permalinks except pagination
- How to custom post navigation
- Pagination with custom field
- toggle Multiple Loop with tittle
- pagination broken – clicking next displays “page not found”
- Pagination for two loops
- Exclude current post but keep the same posts-per_page amount
- WordPress pagination with custom post type?
- wordpress custom fields loop
- How to show related post with category DESC (ASC) IDs of ID current post
- Avoid showing the same phrase in the loops
- Multiple loops on same category with different design
- Multisite – Getting Meta query to select from wp_2 tables
- How to append the excerpt to the content in the single post page?
- Multiple Owl Carousels on the same page with navigation problem
- Pull A Single Post Prior To Running wp_query
- Highlight specific user with custom field value
- custom loop issue
- Secondary loop doesn’t work
- WordPress custom search – pagination
- Pagination on Custom Loop
- Pagination is not working on custom query
- Displaying posts limit: can’t get pagination to display [duplicate]
- Pagination problem with multiple loops on the same page
- WordPress loop problem: Multiple loops, index.php and is_paged causing duplicate posts on next page
- Post thats in Two Categories, only want to display name for one
- Loop display only 5 posts
- Gallery Pagination by Row
- Custom Page Template and Category Exclusion
- Limitless amount of posts in custom archive page
- Advanced Custom Fields in WP_Query: Href Returning Empty
- Display posts by combining multiple meta key
- How to add custom ‘layout’ buttons to wordpress editor?
- How to create custom layouts and static pages in themes for clients
- How to append custom text to the output of ‘categories widget’?
- Showing different pages depending on a cookie value
- How to request container_class from wp_nav_menu
- How to add span on WordPress Title for first and third word
- Hide content and functions from specific user roles
- Custom Content Page
- Media Upload not working after hiding some elements from functions.php
- Centering one product on a single page [closed]
- Add Member’s birthdate from Backend and shows it on frontside [closed]
- Remove link from page title
- Menu not appearing in custom theme
- Custom Post Types database persistance. Why not?
- Many Rewrite Parameters/Rules
- Adding other links on header than LinkedIn, Facebook, Youtube etc
- How can i display custom menu in sidebar?
- Custom select query two tables by a meta key
- How to have multiple WordPress Menus
- Can readers download zip files from WordPress sites?
- Make tag archive display post are ordered by post format
- Create a custom admin panel
- How to customize a site hosted on wordpress.com locally [closed]
- Help customising admin bar, removing buddypress links from dropdown
- how to add wp-user fields to front-end form
- Let author add field to metabox by pressing a button
- Show custom field value as a link
- How to make the Pages in WordPress Customized?
- Custom “wp_login.php?action=lostpassword” and reset password
- Dynamic Control in customiser
- How to auto add nofollow to links in custom field?
- Custom theme – how to link the image without posting it
- How to load a mycred hook from a plugin?
- Create a Page template selector page
- How to add active state to the navigation links?
- Frontpage pagination by week
- How to assign a custom post title to be the post ID?
- Replace a ‘Title’ tag with a Custom Field
- Integrating WordPress with Your Website
- Creating custom page template
- failing to display a custom font [closed]
- WP function duplicating body content
- Which delete query is better with prepare or delete
- Edit specific text on a static page
- How to create a custom WordPress front page
- Customise the Category Widget