I would like to change the default behavior of WordPress regarding the number of articles displayed on a same page to be the following :
- when displaying the home page, the 10 most recent articles should be displayed, 10 being the setting which can be changed through the admin panel (posts_per_page)
- when displaying the articles of a specific month (given through the URL like this :
?m=200906&order=ASC
, I’d like to display on the same page all articles of this month (in other words, I don’t want to have to browse through articles using previous entries or next entries.
EDIT : I forgot something else I’d like to change :
On the page where all articles of the specified month are displayed, I would like to display the comments for each article.
Is this possible to do ? How ?
in your archive.php, add this on top of your template:
Or, if you just have one big index.php template file, do this:
For more detail, look at codex page:
You can probably do this using query_post if you look at the codex page it gives you details of how to do this:
http://codex.wordpress.org/Template_Tags/query_posts
Check out
WP_query
also there are some differences betweenquery_posts
andWP_query
.Both are used to create queries for custom loop. If you want better control over query use
WP_query
.