Title: Display ALL posts
Last modified: June 14, 2018

---

# Display ALL posts

 *  [Dustin Yulo](https://wordpress.org/support/users/dustin00/)
 * (@dustin00)
 * [7 years, 12 months ago](https://wordpress.org/support/topic/display-all-posts-3/)
 * Hello,
 * I would like to ask for any assistance with regards to displaying ALL most viewed
   posts generated by the plugin.
 * I made a list of most viewed posts using the short-code [tptn_list]. If I’m not
   mistaken, the plugin only accepts a minimum of 0 as the number of posts to display.
   I’d like to display ALL posts (just like some other plugins or the default WordPress
   function that if you set the number of posts to “-1” then it will display all
   posts) I’d like to do that and also I’d like to set a POSTS PER PAGE or better
   yet an INFINITE SCROLL with a LOAD MORE button (just like in this webpage [https://www.thepublicdiary.com/stories/](https://www.thepublicdiary.com/stories/))
   so that the page won’t load ALL the most viewed posts at once.
 * Thank you for any assistance or solutions you may provide.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdisplay-all-posts-3%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [7 years, 12 months ago](https://wordpress.org/support/topic/display-all-posts-3/#post-10405190)
 * Please see this implementation which is a custom code of using Top 10 with Ajax
   Load More plugin
 * [https://gist.github.com/ajaydsouza/690784c903242397a351](https://gist.github.com/ajaydsouza/690784c903242397a351)
 * You can set the “limit” to a very huge number like 9999999 which will just pull
   out all the posts in one shot and then do the infinite loading.
 *  Thread Starter [Dustin Yulo](https://wordpress.org/support/users/dustin00/)
 * (@dustin00)
 * [7 years, 12 months ago](https://wordpress.org/support/topic/display-all-posts-3/#post-10405791)
 * Hi Ajay,
 * I’ve implemented the code you’ve shown me and it works fine but I want to get
   the styles and other meta information applied to the posts generated by the short-
   code [tptn_list] because our current short-code only displays title, image, date
   posted and post excerpt unlike the posts generated by the short-code [tptn_list]
   which also displays author and views count.
    -  This reply was modified 7 years, 12 months ago by [Dustin Yulo](https://wordpress.org/support/users/dustin00/).
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [7 years, 12 months ago](https://wordpress.org/support/topic/display-all-posts-3/#post-10406274)
 * If you’re using Ajax Load More, check out this page: [https://connekthq.com/plugins/ajax-load-more/docs/repeater-templates/](https://connekthq.com/plugins/ajax-load-more/docs/repeater-templates/)
 * You should be able to use the modify the template to display the author. To get
   the views you can use: `echo get_tptn_post_count();` which I think might work
   with the template
 *  Thread Starter [Dustin Yulo](https://wordpress.org/support/users/dustin00/)
 * (@dustin00)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/display-all-posts-3/#post-10408579)
 * Hi Ajay,
 * `echo get_tptn_post_count();` doesn’t seem to work and only displays a value 
   of “0” but then I used the `tptn_shortcode_views();` function and now it works
   perfectly. But can I ask if using this function is correct or is it a bad implementation?
   I want to make sure that I did right to prevent future problems.
 * Please visit [This Link](https://www.thepublicdiary.com/popular-stories/) to 
   check the actual output.
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/display-all-posts-3/#post-10412489)
 * That should work. I don’t intend to do anything to that function.
 * You could also directly use
    `get_tptn_post_count_only( get_the_ID(), 'total');`
 * I like the implementation of the way you’ve done it. Would you be able to provide
   the full code? I’d like to add it to the gist above.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Display ALL posts’ is closed to new replies.

 * ![](https://ps.w.org/top-10/assets/icon-256x256.png?rev=2986432)
 * [WebberZone Top 10 — Popular Posts](https://wordpress.org/plugins/top-10/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/top-10/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/top-10/)
 * [Active Topics](https://wordpress.org/support/plugin/top-10/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/top-10/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/top-10/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Ajay](https://wordpress.org/support/users/ajay/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/display-all-posts-3/#post-10412489)
 * Status: not resolved