• Hello

    I’ve been tasked with fixing a WordPress site – namely the archive page metadata. I do not have much experience of WordPress.

    I am trying to understand how the content pages work. If I comment every single line of code out on a content page, then I still somehow have 285 lines of code – mostly header, including meta data, but also the nav bar, hero image, etc. Hero image I assume comes from the back end. But how is it populating the navbar and header? There are no functions once it is all commented out – not even a scrap of code.

    How does it do this?

    On my archive page, I have a function called get_header(), which does what is expected. If I comment out all of my code, then I get a completely blank page, as expected.

    Thanks
    James

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @jamesthemonkeh,

    When you say “commenting out every single line of code on content page” how are you doing this exactly? Are you editing a PHP file? If yes, then which one?

    My guess at the moment is that the file you may be editing would be calling header.php somewhere and hence the result.

    Thread Starter jamesthemonkeh

    (@jamesthemonkeh)

    Hi Tanveer. Thank you for your response.

    I am simply putting <!– at the beginning and –> at the end of the content page (say content-accommodation.php for example) – the whole code block is greyed out on Sublime Text so I am not sure how it is calling header.php?!

    Thanks
    James

    Hi James,

    Yes this is still possible as WordPress may be loading header.php first then yourcontent-accomodation.php and then footer.php. You could follow the loading by attaching a debugger at index.php in your root if you are really interested to know the entire flow ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How Do Content Pages Work?’ is closed to new replies.