• viewmark

    (@viewmark)


    I’ve been trying to create a page with a different header than the one used by my main website. So far, no success. I edited header.php and page.php. I made backups and have since returned these files to their original state (I think).

    For users, the pages now display correctly. But if I try to view the pages while logged in as an administrator, I received an message saying a critical error had occured. I installed the Query Monitor plugin and now I get the following error:
    =================

    Fatal error: Uncaught Error: syntax error, unexpected ‘locate_template’ (T_STRING)
    in /home/viewwebinfo/public_html/empoweringcoorg/wp-content/themes/Largo-master/page.php on line 1

    Call stack:

    require_once()
    wp-blog-header.php:19
    require()
    index.php:17

    ===================

    Here’s what’s in my page.php file:

    ====================

    <?php
    
    /**
    
     * The Template for displaying all pages.
    
     */
    
    locate_template( 'single.php', true );

    ====================

    Thanks for any help you can provide.

    • This topic was modified 4 years ago by bcworkz. Reason: code fixed

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    There’s no syntax error in what you posted. The most common reason for that error is the previous code line is missing its terminal ; character. Comments don’t need a terminal ;.

    It seems like you have the wrong page.php, as the error occurs on line 1. Your locate_template is on line 5 if we disregard extra carriage returns.

Viewing 1 replies (of 1 total)
  • The topic ‘Pages Not Displaying in Administrative View’ is closed to new replies.