Showing all the posts in one page?

There are over 200 posts tagged with the keyword “Apple.”

Each tag page — example.com/tag/apple/page/2/ — shows 10 posts.

So there are 20 tag pages.

Is it possible to show all these 200 post (links) in one page? I don’t want to show any of the excerpt — just consolidate all those 200 links in one page.

Appreciate your help!

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

This is what I would consider the correct solution, and is the solution alluded to by Milo’s comment (if I am not mistaken).

function alter_ppp_for_tags_wpse_88337($qry) {
  if ( is_tag() && $qry->is_main_query() ) {
    $qry->set('posts_per_page','-1');
  }
}
add_action('pre_get_posts','alter_ppp_for_tags_wpse_88337');

Using query_posts will cause two requests to the database– the main query, and the query triggered by the use of query_posts. By using a filter on pre_get_posts you alter the main query before posts are fetched and thus only hit the database once.

Reference:

http://codex.wordpress.org/Class_Reference/WP_Query

Method 2

Its possible. You need to modify parameters in query_posts(). Use:

query_posts('tag'=>'apple', 'posts_per_page'=>-1)

'nopaging'=>1 can also be used for listing all items. Check Parameters for detail.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x