PHP Build a Basic PHP Website Listing and Sorting Inventory Items Displaying All Items

getting only 2 columns grid

I'm only getting 2 columns grid in the catalog section any help ! And here is the code for the that page.

<?php include("inc/data.php");

$pageTitle = "Full catalog"; $section = null;

if(isset($_GET["cat"])){ if($_GET["cat"] == "books"){ $pageTitle = "Books"; $section = "books"; }elseif($_GET["cat"] == "movies"){ $pageTitle = "Movies"; $section = "movies"; }elseif($_GET["cat"] == "music"){ $pageTitle = "Music"; $section = "music"; } }

include("inc/header.php");?> <div class="section catalog page"> <div class="wrapper"> <h1><?php echo $pageTitle?></h1> <ul class="items"> <?php foreach($catalog as $item){ echo "<li><a href='#'><img src='" . $item["img"] . "' alt='" . $item["title"] . "' />" ."<p>View Details</p>" ."</a><li>"; } ?>
</ul> </div> </div>

<?php include("inc/footer.php");?>

1 Answer

Angelo Maiuri
Angelo Maiuri
8,353 Points


Your PHP looks fine to me. Please check your CSS, I think the problem might be hiding there.

Good luck, Angelo