Title: Modified index.php (root)
Last modified: August 20, 2016

---

# Modified index.php (root)

 *  [akensai](https://wordpress.org/support/users/akensai/)
 * (@akensai)
 * [15 years ago](https://wordpress.org/support/topic/modified-indexphp-root/)
 * Alright so I decided to add side images via tables to my blog (if you can call
   it that.)
 * I have been using WordPress for quite awhile, but I’m pretty stuck on this one,
   thus finally registering a user to ask here on the forums.
 * Here is my “test” index:
 *     ```
       <div align="center" style="height:100%;width:100%;">
       	<table border="0" cellspacing="0" cellpadding="0" rules="none">
       		<tr>
       			<td height="500px">
       				<div style="background-image: url(http://imgeasy.com/images/bf3.png); height: 498px; width: 200px; border: 0px;"></div>
       			</td>
       			<td>
       				<?php define('WP_USE_THEMES', true); require('/home/akensaivps/akensai.com/wp-blog-header.php'); ?>
       			</td>
       			<td height="500px">
       				<div style="background-image: url(http://imgeasy.com/images/bf32.png); height: 498px; width: 200px; border: 0px;"></div>
       			</td>
   
       		</tr>
       	</table>
       </div>
       ```
   
 * As you can see, I am trying to do the 3-cell table trick for side images, the
   problem is that WordPress doesn’t seem to want to work when the wp-blog-header.
   php is NOT being called first.
 * You can view the test page @ [http://akensai.com/test.php](http://akensai.com/test.php)
 * **What happens when this page is set as index.php:**
    “Cannot modify header information–
   headers already sent by (output started at /home/akensaivps/akensai.com/index.
   php:8) in /home/akensaivps/akensai.com/wp-includes/pluggable.php on line 897”
 * styles don’t seem to work correctly, aka: text format, font, etc – everything
   else (background, divs, etc seems to work)
 * General links no longer working
 * Any insights are appreciated!

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Moderator [Helen Hou-Sandi](https://wordpress.org/support/users/helen/)
 * (@helen)
 * Core Lead Developer and 4.0, 4.7, and 5.6 Release Lead
 * [15 years ago](https://wordpress.org/support/topic/modified-indexphp-root/#post-2099682)
 * Why are you doing this to the root index.php?! You should never, ever edit WP
   core files! </lecture>
 * Visual changes should be made in your theme files (wp-content/themes/minimal/
   in your case). You definitely shouldn’t be using tables to control your layout,
   and if the images are background images rather than content, they should be in
   your CSS, not HTML. Your site looks like it’s fixed width – you could combine
   those two images with the requisite amount of space between them and set it as
   the background image for the body (not repeating, hopefully) or another wrapping
   div if you’re not into CSS3 multiple background images (good but not complete
   browser support). If you want to test changes, try making a child theme and previewing
   it or using a plugin to switch themes for you as the admin user.
 * Child themes: [http://themeshaper.com/2009/04/17/wordpress-child-theme-basics/](http://themeshaper.com/2009/04/17/wordpress-child-theme-basics/)
   
   Theme preview plugin: [http://wordpress.org/extend/plugins/theme-preview/](http://wordpress.org/extend/plugins/theme-preview/)
 * The error itself means that you are sending information to be printed in the 
   browser before WP usually sends header information. Since you list yourself as
   having advanced PHP and HTML skills, I apologize if I’m telling you something
   you already know. WordPress can’t work as expected unless its core files are 
   loaded properly; in this case by declaring a constant and then requiring the 
   wp-blog-header.php file. Once you start mucking with core files, you set yourself
   up for… well, errors like that one.
 *  Thread Starter [akensai](https://wordpress.org/support/users/akensai/)
 * (@akensai)
 * [15 years ago](https://wordpress.org/support/topic/modified-indexphp-root/#post-2099767)
 * Right, in theory it should work since the only thing altered in the index.php
   is adding tables. I know it’s a bad idea to edit the core files, but its the 
   easiest way to do what I want to do.
 *  Moderator [Helen Hou-Sandi](https://wordpress.org/support/users/helen/)
 * (@helen)
 * Core Lead Developer and 4.0, 4.7, and 5.6 Release Lead
 * [15 years ago](https://wordpress.org/support/topic/modified-indexphp-root/#post-2099768)
 * No, in theory it should **not** work and it’s **not** easy. The root index.php
   is not a visual thing at all, it’s just a loader file, and you are going to get
   errors with headers sent if you put output in that file. If you want to change
   the way your blog **looks**, you should be altering the template files in the
   theme folder.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Modified index.php (root)’ is closed to new replies.

## Tags

 * [index](https://wordpress.org/support/topic-tag/index/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [Helen Hou-Sandi](https://wordpress.org/support/users/helen/)
 * Last activity: [15 years ago](https://wordpress.org/support/topic/modified-indexphp-root/#post-2099768)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
