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 trialBrodie Capel
16,365 PointsAdding Content Custom Places - Part 2
IM STUCK! im doing The how to build a wordpress theme class, im up to the video Adding Content Custom Places - Part 2. in this video we add a recent post, a featured post and a recent work section to the front-page.php file of our template.... i have the featured and recent posts working... but when ever I do the recent work section... i have done it like 6 times as the video says.... it displays all my work.. not just one as it should? any ideas?!?!
1 Answer
Nora Demirjian
7,160 PointsIf I'm not mistaken, to show the single project in the work section you have to create a single-work.php.
and then...
Brodie Capel
16,365 PointsBrodie Capel
16,365 PointsThanks for you time... but this is quite what i'm talking about.... on the home page of the project there is supposed to be a display of a recent project. i have everything working but its showing all 4 projects.. not just one.. I think im just going to go over the video again and recode try and iron out a bug.... i probs only missed one single bracket or something. :P rookie mistakes.. make things brake.
Brodie Capel
16,365 PointsBrodie Capel
16,365 PointsJust for the record.... I still couldn't get it after deleting the files and re-coding from scratch.... however i came up with a work around...
'post_per_page' => 1
fixed it.... dont know why i didnt think about it sooner.... after re-visting the video.. they didnt include this.. but if it works... it works.
Pedro Baumann
12,815 PointsPedro Baumann
12,815 PointsBrodie, that is exactely what they forgot to add to the video, however, When I add that (was my first idea) it just crashes php!!!
Anyone else has a clue about why this might be? It's not a syntax error, I have c/p the same code I used before in other parts:
Pedro Baumann
12,815 PointsPedro Baumann
12,815 Pointsnevermind...just spoted the mising comma.....(bangs head against screen...)
Jeesun Kim
4,866 PointsJeesun Kim
4,866 PointsI have the same problem. 'post_per_page' doesn't work for me. Ahhh where is this missing comma for me?
Jeesun Kim
4,866 PointsJeesun Kim
4,866 PointsActually 'posts_per_page' worked. But why didn't it work without it?