In the wordpress admin you can set “Blog pages show at most” under Settings>Reading
Is it possible to get the value of that to use in my theme? Could I also alter its default setting from my theme pages without going trough the admin? (set it to 20 for example)
Thanks dor your help guys!
I think you’re interested in
get_option( 'posts_per_page' );
, which basically tells you what to look for in thewp_options
table. You can find details here.Also, if you want to change this option, you can do it with this.
The option you are looking for is posts_per_page and you get it like:
You could alter the default setting conditionally by using the option filter on your theme page like so: