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 trialmohammed mayat
4,228 Pointspage not displaying properly
i had to comment out header and nav to get the page looking the same, has anyone else had this problem https://w.trhou.se/5ol77rktex
1 Answer
Dan Weru
47,649 PointsHey, you just need to tweak you code a little. The purpose of including the header.php file in the index.php and suggest.php is so that you can avoid repeating code.
In other words the code inside the header.php should not be repeated in the index.php nor in the suggest.php. Therefore your index.php should look like
<?php include("inc/header.php"); ?> <!-- this line pulls in the code from header.php -->
<div class="section catalog random">
<div class="wrapper">
<h2>May we suggest something?</h2>
<ul class="items">
<li>
<a href="details.php?id=201">
<img src="img/media/forest_gump.jpg" alt="Forrest Gump"><p>View Details</p>
</a>
</li>
<li>
<a href="details.php?id=204">
<img src="img/media/princess_bride.jpg" alt="The Princess Bride"><p>View Details</p>
</a>
</li>
<li>
<a href="details.php?id=302">
<img src="img/media/elvis_presley.jpg" alt="Elvis Forever"><p>View Details</p>
</a>
</li>
<li>
<a href="details.php?id=303">
<img src="img/media/garth_brooks.jpg" alt="No Fences"><p>View Details</p>
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="footer"><!--end content-->
<div class="wrapper">
<ul>
<li><a href="http://twitter.com/treehouse">Twitter</a></li>
<li><a href="https://www.facebook.com/TeamTreehouse">Facebook</a></li>
</ul>
<p>©2015 Personal Media Library</p>
</div>
</div>
</body>
</html>