You can use the wpmu_new_blog
action to automatically set the default to 6 for new installs:
function wpse_139900_default_posts_per_page( $blog_id ) {
update_blog_option( $blog_id, 'posts_per_page', 6 );
}
add_action( 'wpmu_new_blog', 'wpse_139900_default_posts_per_page' );
If you don’t want your users to be able to change this setting, you can just override it instead:
function wpse_139900_posts_per_page() {
return 6;
}
add_filter( 'pre_option_posts_per_page', 'wpse_139900_posts_per_page' );
Either way, you should never use your own query on top of the default loop – it’s just unnecessary overhead that can be avoided by tweaking the main query.
Related Posts:
- wp-admin pages return ERR_EMPTY_RESPONSE
- Reorder custom submenu item
- WordPress custom permalinks not working on OS X localhost
- What is an “Options Framework” for WordPress
- WordPress address URL keeps dropping the www
- using wp_sprintf at wordpress option page,
- WordPress Options Page not working
- How to change user admin_color with WP CLI?
- Hide admin menu on update_option
- Custom plugin admin page issues
- unsuccessful attempt to change domains- wordpress re-routing to old domain
- Form input values are empty after submit
- Admin page changes the $_POST data
- Some fields in Settings API form are saving, others are not
- How to Fix WordPress Not Saving Settings?
- Options site set empty fields after submitting
- I am not able to enable jQuery in theme settings
- Cannot Update wp DB – Get 500 Error
- Creating your own options-general.php page
- sortable custom column in media library
- how do I force a single column layout in screen layout
- Sortable admin columns, when data isn’t coming from post_meta
- wp_list_table search box does not show
- stop redirection on /wp-admin call to /wp-login
- How to Display Post Excerpts in Admin by Default?
- Wp3.5 Media Gallery Edit modal: change captions to title
- What is the capability that permits access to WP-Admin?
- WordPress in sub directory wp-admin problem
- Enqueue Javascript Correctly for 3.5
- Is it possible to set a option, and then redirect to another page directly from a admin notice link?
- Adding body class to login page?
- How to load a CSS file into WordPress admin area using Child Theme? [closed]
- Getting “Cannot modify header information – headers already sent” error, but only on backend
- WordPress admin menu gap when debug mode is enabled?
- Why I can’t change the permalink of this page?
- Call to undefined function insert_with_markers
- Cookie value cannot be read until I’ve logged into the WP admin
- What corrections does this code need?
- Admin Blank Page with Working Front-End After Updating to WordPress 4.6
- Distinguish profile user and admin user IDs / get ID of user being edited
- Moved wordpress from localhost to live and wp-admin shows white screen
- Auto create post title in admin
- Redirect non-admin users away from wp-admin/index.php (main dashboard page) to wp-admin/profile.php
- How to add wordpress blog to Windows 2008 R2 site
- WordPress disable ‘Install Themes’ tab
- WordPress Admin Not Loading All Core Scripts
- Admin table list API?
- wp-admin – 404 after custom login form
- How to apply a CSS file to my admin pages?
- How to create admin tabs [closed]
- Having troubles connecting to WordPress login page using Mamp
- Unable to log in to localhost wp-admin page on XAMPP server
- Remove or move admin submenus under a new menu
- Can content be recovered in this situation?
- Efficient way to check local WordPress php files and Database for malicious code? [duplicate]
- Why am I locked out of the system?
- Is it possible to create two different wp-admins for a wp website
- Making Comments, a sub_menu in admin menu
- Link blogname and blogdescription to the Options Framework
- Without using wordpress cms Is it possible to signup from my html page
- retain querystring values when savincustom options in admin
- How to allow WordPress updates to only one specific administrator?
- How to add custom CSS and JavaScript file for wp- admin dashboard (backend)
- GoDaddy hosting wp-admin problem
- Cannot change Connection Information in admin interface
- Add custom fields to a page template, admin side
- Error messages & can’t reach admin after upgrading to 3.4.1 WordPress
- WordPress blog clone.. wp-admin issue
- Newly created user role not displaying on users screen
- Could not override the url in wp-config file
- How do I fix wp-admin error when exporting reusable blocks?
- WordPress Migration Post Problems
- How to remove the color picker code from users-edit.php
- wp-config.php not affecting my site
- How to prevent spams from admin-ajax.php file?
- Can’t access WP-Admin via HTTPS
- wp-admin and wp-login.php not Accessible after Cloudflare
- Strange wp-admin problem for all users/adminstrators except the original one?
- Get rendered HTML of Page in Admin Area
- Having SSL enabled on admin, but disabled on post preview and live preview?
- Strange URLs admin area bug
- Cannot access my wordpress website
- Google flagged a wp-admin redirect as phishing
- Problem with admin columns
- Checkbox not showing as checked on UserProfile (even with checked=”checked”)
- Get URL of current featured image with JS in edit post view
- Added fields in quick edit screen need to update at the moment
- Custome column sort by date not title
- WordPress Admin: open popup window on a custom button
- Modify admin panel tab position
- No HTML/Visual mode option in admin panel (New Post)
- Removing Author name
- not able to add thumbnail custom field in dropdown
- No wp-admin, wp-config, or .htaccess folder/file
- Taking over a WordPress site
- WordPress blog fails to open
- wordpress admin is broken [closed]
- LinkControl not showing suggestions when used on admin page
- My website does not load since two days!
- how to Hide all products except the General Manager role in the WordPress admin panel?