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
- Multiple Inputs in a Customizer Control
- Embedding a SOAP Client into a WordPress Plugin?
- Rearrange elements outputted by comment_form()
- How to build custom WP admin with custom URLs
- Custom editor field displaying HTML in Visual editor
- How to set default values for options page
- How to import custom data via XML, CSV, etc
- Widget Javascript code (ajax)
- How to remove query string from static resource in WordPress?
- Modify a theme to insert custom widgets?
- How can I defer these JS files?
- Changing layout with wp_customise
- Allow non-admins to access the Customize theme page
- Query post for ‘selected category’ in archive.php
- Blog page pagination is not working after using the offset argument
- How Can I Move Data From Form 1 To Form 2
- wp_query get post custom taxonomy in search.php
- Custom login with external provider iframe and data object
- get author in blog posts?
- Users can only view their content from the front end
- Localization: I want the backend: english and frontend in defined language
- Theme compression/ minifying or W3 Total Cache – which should I use? [closed]
- Widget title markup in register_sidebar
- What is theme-editor.tmp?
- More tag – how do I remove preceding ?
- Salesforce lead tracking with contact forms plugins [closed]
- Stop Expansion of Top Level Menu in the WordPress Admin Sidebar
- Add or Create Custom Structure Tags to Permalink
- Remove welcome panel from contact form 7 page [closed]
- How to remove admin menu pages inserted by plugins and themes in the top admin bar?
- WordPress custom dropdown listings
- Help customising admin bar, removing buddypress links from dropdown
- Do I need to instantiate the XMLRPC class or any class in another class to access its methods?
- Page not found yet the posts are listed?
- how or where wordress collect unlogged user session
- Customizing woocommerce product page
- Woocommerce custom “My Account” Tab – Add Save button
- WordPress Using Zip code customer shop find without woocommerce plugin
- how can custom permalink structure use for specify custom post type
- Add button to My Sites dashboard page (multisite)?
- Embedded Options in a Custom Metabox
- Logged in only custom page
- Make Terms Under Custom Taxonomy Use Specific Single.php Template
- Search results load individual post in slide out div
- Problem Locating and Changing Alt Attribute Of Link
- Show Site Name on WP login screen
- Adding css and js to a blank page created with custom template
- Conditional tag