to change the number of posts per page you can do it in the wp dashboard
like in this picture
This function on functions.php works for me
function tcPostsPerPage( $query ) {
if (is_home()){$query->set('posts_per_page', 6);}
if (is_archive()){$query->set('posts_per_page', 6);}
}
add_action( 'pre_get_posts', 'tcPostsPerPage' );
the two 6 is limiting to 6 per page, if this doest work for you, its a question of changing the is_archive() to something like is_page(‘yourpage’)
also if it works you can remove the ‘posts_per_page’ of your array, and the variable attached.
Related Posts:
- Order get_terms using a Custom Field
- Display Custom Taxonomy Terns ordered by meta_value
- Listing child terms of parent term
- Ordering Posts with Custom Taxonomy Terms Array
- Sort order by slug for looped child terms of custom taxonomy
- Weekdays as terms – How to order taxonomy terms by ID in admin panel?
- How can I change the output display of my pagination?
- How to add a date creation field when a custom taxonomy relationship is created?
- Order taxonomy terms wordpress
- add pagination in wordpress page template
- Orderby taxonomy term id using get_posts not working
- Sorting terms individually for each post
- Tax query array terms display out of order
- Order posts with custom taxonomy array
- Get the the top-level parent of a custom taxonomy term
- get_terms – only top level
- How to only list the child terms of a taxonomy and not their parents?
- Hierarchical taxonomy UI
- Hide the term description on the term edit page, for a given taxonomy
- get_term_by not working when in functions.php
- Can I lock down custom taxonomies on a parent term level, but not a child term?
- Get only the first term by taxonomy
- Exclude specific slug in ‘get_terms’
- get_terms() returns an empty array
- Custom Taxonomy Only Showing Top Level Terms in Admin?
- Is it possible to get a Previous/Next Taxonomy term archive URL?
- WP_insert_term how to insert multiple values as taxonomny term?
- Group posts that matches a term in a loop
- How to display term description in empty terms archive?
- Checking if a Page has an Associated Term?
- What are terms and taxonomy, how they related to post and how these three are stored in database?
- Get multiple term objects by ids
- Echo custom taxonomy term name
- get_terms custom order
- Remove pagination from WooCommerce product categories on admin edit navigation menus
- Limits amount of terms displayed? Is it possible?
- How to List Parent Term Links for Custom Taxonomy With & Without Children?
- Why does WP rename similar “term name”-slugs in separate taxonomies?
- How can I get WP to build a feed based on multiple taxonomy terms
- Check if term is in a taxonomy?
- Get child product categories from parent product category in WooCommerce
- Set custom post type terms by id without knowing taxonomy
- get_terms orderby numeric
- How to determine the depth of a term in a custom taxonomy?
- get_term_children doesn’t return an array of children terms
- How to show only terms by id or slug on edit-tags.php (custom taxonomy manage page) for a custom taxonomy
- Display the description of taxonomy terms
- get_terms adds slaces to the resualt
- Term count by user
- get_term and get_term_by return null or false, even though term exists
- How to add contents of a custom field to a taxonomy term list?
- one term two taxonomy’s?
- How to create pagination for custom taxonomy in WordPress
- Getting WooCommerce product related child categories
- problem in taxonomy-{taxonomy}.php pagination
- Query posts from a child taxonomy term id
- get_terms() duplicate first term of a custom taxonomy
- Having Issue on Passing Variable into HTML Class Tag
- Echo custom taxonomy slug
- Admin (All posts) stop responding problem
- Query posts using custom taxonomy and selected terms
- Proper use of wp_get_object_terms
- Remove a href from this code
- Output all terms in a custom taxonomy and add a “active” class only to the ones attached to the current post
- one post per term taxonomy
- How to check if a post has at least 2 terms from a custom taxonomy attached?
- Can’t get taxonomy ID for each post on archive page
- Terms change id after importing
- delete term from taxonomy and assign in new one
- Adding Child Terms Programatically – No Warning but No dice either
- Show related posts on single.php, grouped by taxonomy terms, with Advanced Custom Field post object selected
- Running a function only once when a taxonomy term is changed
- Set post terms by term id
- Displaying my custom taxonomies in a using the_term_list()
- Use wp_list_categories to list parent categories from actual term
- Trash Bin for Categories?
- using wp_insert_term to create custom terms for a custom taxonomy from frontend form,
- is there a way of getting term children that only shows those from two taxonomies
- Display term picture of each post in a loop
- Get Terms of custom Taxonomy of products with certain Product Category
- Problems using get_the_terms in a plugin
- How to add a shortcode function that returns the taxonomy slug of the actual post within the loop
- Tree view wp-admin terms
- Retrieve the child terms by having the parent’s information
- Random order not working correctly when using default loop + $query->set
- Order get_terms by count using a custom taxonomy hierarchy
- How to create a non removable taxonomy term?
- WordPress taxonomy terms archive template help
- Show message if term slug changed
- Pagination for Custom Taxonomy
- Why get_terms() behaves strangely when being called in admin (for use in meta box)?
- qtranslate-x problem with custom term description
- Change order custom taxonomy
- Pagination with custom query (not using posts)
- get_terms returns array starting at 4
- Multiple category lists on one page
- query posts returns 10 records
- get_the_terms inside save_post gives old terms
- add_rewrite_rule pagination 404 error on page 4 and above
- Hide empty categories on widget