Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJohannes Böhm
5,957 PointsOnly 10 Portfolio Pieces get displayed
Hello Zac and other guys, I enjoyed and followed the "From Bootstrap to Wordpress" Track and got everything up and running. BUT there is one thing that confuses me. When I try to add more than 10 Portfolio Pieces as Pages they dont get displayed on the front-end, although the additional pages get listed in the Wordpress back-end.
Has anyone an explanation for this issue? Someone facing the same issue? Does someone maybe have a solution for this? This would be awesome...
Looking forward to your feedback...
Thanks in advance and best regards, Johannes
5 Answers
George Cristian Manea
30,787 PointsWordpress has a standard 10 posts or pages display. You will have to chage this in the settings=>reading section
George Cristian Manea
30,787 PointsHere you can find a code for pagination http://stackoverflow.com/questions/4648956/query-posts-with-pagination-not-working
Just remember that if you set posts_per_page = -1 in the query posts it will display all the posts in that category
Johannes Böhm
5,957 PointsThank you George - really awesome,.. also that the fix is that easy. :) Is there a chance to add some pagination option if the page limit is exceeded?
George Cristian Manea
30,787 PointsYou used a query_posts to display those 10 portfolio pieces ?
Johannes Böhm
5,957 PointsYes I did.
Matt Campbell
9,767 PointsYou need to add a pagination function and then include that where you want it in your template file.
As for the query, use WP_Query and add in posts_per_page and paged to the array.
Have a read of the codex and Google WordPress pagination. There's masses out there regarding it.