variables - Wordpress: Change number of posts from administration -


i have problem showposts.

$recent = new wp_query('showposts=10'); while($recent->have_posts()) : $recent->the_post(); 

and change number of "showposts" administration.

i found instruction how create widget in /wp-admin/ dont know how create simple form change , save number of showed posts.

thank help.

under settings > reading in wp-admin have configuration of how many posts shown in each page of queries. can remove 'showposts' parameter , wordpress value configured in wp-admin.

also, showposts deprecated. should use 'posts_per_page' :)

https://codex.wordpress.org/class_reference/wp_query#pagination_parameters

hope helps.


Comments

Popular posts from this blog

php - Passing multiple values in a url using checkbox -

compilation - PHP install fails on Ubuntu 14 (make: *** [sapi/cli/php] Error 1) PHP 5.6.20 -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -