• Resolved jamiedustuk

    (@jamiedustuk)


    Hi, i have a site that already has a static home page on wich is a php file that i need to keep that way,

    i am using wordpress as a feedback system for a number of my pages that i want to keep in the root…

    ive managed to get my home page (index.php) to display correctly by removing all wordpress stuff from the index.php within my template, however my single post still has my home pages static content in: https://www.tuinauk.com/treatments-reflexology

    this shouldnt be as what does my index.php in the root do apart from call blog headers etc? my layout should be controlled by my template and i have a single.php wich it is using but then displaying my index.php straight after

    is there anyway i can have static content in my index.php

Viewing 4 replies - 1 through 4 (of 4 total)
  • What do you mean by static content? Just create a WordPress page, then in Options -> General, use that page as your home.

    Thread Starter jamiedustuk

    (@jamiedustuk)

    the things is the home pages content is quite complex, plus it has product feeds from the online shop wich is part of the site so theres no way wordpress can do the job with a page

    after playing around ive figured out the only issue i have is that any content i have in my index.php apart from the blog headers shows up beneath my blog pages, if you take a look here: https://www.tuinauk.com/treatments-reflexology you will see that after the comment form you get all the home page content

    is there any way of not using index.php as the base file or of making post pages ignore everything after the headers?

    if not then the only 2 options i have is to either move my blog ‘again’ into another directory or to make my home page something like home.php and use a meta redirect on an index.html to point it there, which i would rather not do as it will hinder my seo…

    I think you might be better doing what kennethwatt suggested – its how wordpress is designed to work. Sure you could probably get what you’re attempting to do to function but the base assumption with a wordpress installation is that there will be an index.php

    ..so theres no way wordpress can do the job with a page

    yes there is – you can make wordpress serve up any existing HTML/PHP

    Take your existing homepage and define it as a page template (it doesnt have to contain any wordpress related code if you dont want it). Create a page, select the template, then under Reading settings set it as your homepage.

    you dont need to use index.php to define the site’s homepage – wordpress will allow you to set any wordpress page you wish as the home page

    Thread Starter jamiedustuk

    (@jamiedustuk)

    thanks, that worked a treat, i was worried about relative links but it works like a dream

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘can I have static content in my index.php’ is closed to new replies.