• Resolved ndjworldnews

    (@ndjworldnews)


    Hello;

    How can I start up a wordpress theme with a new index.php file that using the command

    <head>
          <meta http-equiv = "refresh" content = "3; url = /start.php" />
    </head>

    to load the original index.php that I renamed to start.php?

    Whilst the new index.php loads fine and displays the content of it fine, after executing the meta command, I get a file not found error instead of all the posts listed. Everything in the start.php file is original and unchanged. Only the file name got renamed from index.php to start.php.

    For clarity:

    Renamed original theme index.php to start.php
    then created a new index.php that contains code to display a logo and the command listed above; nothing else.
    start.php (which is the original index.php) loads up but then I get the error mentions.

    If I undo the changes and load the default index.php file as such, everything works fine.

    Any suggestions?

    Thank you

    Lode

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator bcworkz

    (@bcworkz)

    A theme’s default index.php file is required to run a standard WP loop. There is a lot of core code that assumes this is the case. It must work to output query results when no other template file is found.

    What is it that you are trying to accomplish? There’s likely a better way than by crippling index.php.

    Thread Starter ndjworldnews

    (@ndjworldnews)

    Hello;

    thank you for your response. I am trying to load a logo (full page) that remains on screen for a couple of seconds until the actual theme is loaded.

    I tried sitename.com/start.php which contains the logo code and displays it. this file also contains the html code

    <head>
          <meta http-equiv = "refresh" content = "3; url = /index.php" />
    </head>

    After 3 sec, the index.php file is loaded, showing me the header and the footer but ‘not found’ error where the posts suppose to be displayed.

    Thank you.

    Lode

    Moderator bcworkz

    (@bcworkz)

    I see. You know, that sort of thing is very web 1.0 ?? It’s discouraged by many web designers due to performance issues. It’s not good for SEO either. It’s your site though. If it’s what you want you can do it. Just not with index.php.

    What I recommend doing is including the full screen logo as a modal element on the page which is initially displayed on page load. On some event (mouse move, click, timer count, etc.) the modal is cleared with JavaScript by altering the element’s CSS class so it becomes hidden and normal page content becomes visible. This way you avoid redirects and improve the page’s SEO. The necessary HTML could be added to your index.php template file provided it still outputs normal page content as well. You’ll also need additional CSS and load the JavaScript which adds an event listener that changes the modal class attribute.

    Thread Starter ndjworldnews

    (@ndjworldnews)

    Hello;

    Thank you for your response. I’ve decided to ‘leave as is’. I am not too familiar with Javascript so … not going to mess with it.

    Thank you for your honest answer.

    Lode

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Start theme with different file?’ is closed to new replies.