6.7. Creating Different Viewing Styles for the Pages

You're nearly finished with this stage of your blog's development. However, if you navigate to the "About the Author" page, you'll see that it shows an entry preview. This is undesirable because there should be only one entry on this page.

To fix this, you need to modify your retrieveEntries() function to force the "About the Author" entry to be a full-display entry, even without a URL being supplied.

Open functions.inc.php and modify retrieveEntries() by inserting the following code in bold into the while loop starting at line 38:

// Loop through returned results and store as an array
        while($row = $stmt->fetch()) {
            if($page=='blog')
            {
                $e[] = $row;
                $fulldisp = 0;
            }
            else
            {
                $e = $row;
                $fulldisp ...

Get PHP for Absolute Beginners now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.