• Resolved OTT

    (@dms666)


    I can’t seem to figure out what page is actually getting loaded with my site.

    I have a custom theme and a static home page (with a permalink to the website: https://www.ottas.ca).

    However, using the browser’s “View source” on the home page shows an HTML page which includes the content from the home page as well as for the slider, header, footer, etc.

    For example, here’s a snippet from the View Source:

    <div id=”main” style=”overflow:hidden !important;”>
    <div class=”OTTAS-row”>
    <div id=”content” class=”full-width”>
    <div id=”post-3520″ class=”post-3520 page type-page status-publish hentry”>
    <div class=”post-content”>
    –>Home page stuff shown here<—

    Which page is being displayed when viewing the source? Is this a dynamic file which loads the pieces together?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Phil

    (@websterwebguru)

    When loading a static page your theme is using page.php or front-page.php. Or possibly another variation of page-*.php.
    Hopefully this helps

    Thread Starter OTT

    (@dms666)

    There is no front-page.php

    There is page.php in my theme folder, however, it’s only half a page of <div> statements, php if statements and such.

    Phil

    (@websterwebguru)

    If you are trying to edit the template file for your home page you can copy your page.php into a new file called front-page.php (which will now be used to load the home page, if your theme is indeed using page.php for the home page you shouldn’t see any change since it is a copy of the same code). Once here you can edit the new front-page.php to your liking.
    Let me know if this helps.

    Thread Starter OTT

    (@dms666)

    Hoperfully a simply question: let’s say I needed to add a snippet of html code to my “home page”. Which file do I add it to?

    Real-life case: I need to add a few lines of html code to our site to support Google in displaying our logo when our site shows in search results.

    In practice: I added it to the header.php as it was the only file I could find that was actually defined as DOCTYPE HTML. I edited via WordPress->Appearance->Editor-> and selected Header (header.php).

    Phil

    (@websterwebguru)

    What WordPress does is it takes all of these template files and builds the site with them. You can put html in any of the php files. There are a couple of different ways to do this. You should be able just use what is already in the file as an example of how to do this.

    Phil

    (@websterwebguru)

    What WordPress does is it takes all of these template files and builds the site with them. You can put html in any of the php files. There are a couple of different ways to do this. You should be able just use what is already in the file as an example of how to do this.

    Thread Starter OTT

    (@dms666)

    I added it the header.php and Google picked it up properly in the search results.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘WordPress with custom theme – index page?’ is closed to new replies.