Title: Adding HTML to PHP
Last modified: August 18, 2016

---

# Adding HTML to PHP

 *  [snowboardkid](https://wordpress.org/support/users/snowboardkid/)
 * (@snowboardkid)
 * [20 years ago](https://wordpress.org/support/topic/adding-html-to-php/)
 * Hi all,
 * Thankyou in advance.
 * I’ve been fumbling my way around using wordpress and am having fun learning new
   things. Anyway, after much searching I figured out how to enable scrolling on
   IE in the admin section of wordpress (needed on my blog because I’m loading the
   whole thing in an iframe). All that is needed is to add the following code to
   the wp-admin/admin.php file (you may or may not need the head tags, I’m not sure).
 * <head>
    <style> <!– body { overflow-y: scroll; } –> </style> </head>
 * However, the admin.php file contains only one big <?php ?> and I know I can’t
   add my html code after the ?> otherwise I get an error but I can’t add it before
   the ?> because I get an error.
 * So how do I add it to the admin.php file without breaking the php? I know there
   must be a valid open and close php tag that I can use after my inserted HTML 
   that won’t break it. Does anyone know what this is?
 * Thanks once again,
    Rick.

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

 *  [Samuel B](https://wordpress.org/support/users/samboll/)
 * (@samboll)
 * [20 years ago](https://wordpress.org/support/topic/adding-html-to-php/#post-399476)
 * When adding html to a php file don’t forget:
    `<html>codecodecode</html>`
 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [20 years ago](https://wordpress.org/support/topic/adding-html-to-php/#post-399490)
 * Hmm. Seems like you should just add this:
    `body { overflow-y: scroll; } To the
   wp-admin.css file instead. It would have the same effect and you wouldn’t have
   to screw around with the php code.
 *  Thread Starter [snowboardkid](https://wordpress.org/support/users/snowboardkid/)
 * (@snowboardkid)
 * [20 years ago](https://wordpress.org/support/topic/adding-html-to-php/#post-399540)
 * @ samboll: Thanks mate although it seems as though that makes no difference. 
   It works without the <html> tag. If I add the <html> tag and paste my code before
   the ?> php tag it still errors out on me.
 * [@otto42](https://wordpress.org/support/users/otto42/): Thanks for the help. 
   I just tried that and when I view a users profile it doesn’t work in IE. Perhaps
   I need to add it another selector? your-profile perhaps? Why wouldn’t it be applying
   to all?
 * Thanks again for all the help.
 * Rick.
 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [20 years ago](https://wordpress.org/support/topic/adding-html-to-php/#post-399577)
 * Well, if you want to try it your way, you’ll need to edit admin-header.php. Find
   the <head> bit, and add this just after it:
    `<style> body { overflow-y: scroll;}
   </style>
 * But don’t add the /head or anything else.
 * Still, I don’t think that would make any difference. Putting it in wp-admin.css
   would be just as good, really. Maybe it doesn’t do what you think it does. What
   are you hoping to accomplish here?
 *  Thread Starter [snowboardkid](https://wordpress.org/support/users/snowboardkid/)
 * (@snowboardkid)
 * [20 years ago](https://wordpress.org/support/topic/adding-html-to-php/#post-399693)
 * Otto42,
 * Thanks so much for the help. I appreciate it. What I want to achieve with this
   bit of code is force there to be a vertical scroller in the admin section of 
   wordpress. As my site (www.popmag.com.au) loads in an iframe this is crucial 
   as by default, there isn’t a scroll bar in the admin section wehn using IE. So
   when I ad:
 * <head>
    <style> <!– body { overflow-y: scroll; } –> </style> </head>
 * To the wp-admin/admin.php file I get a scroll bar exactly where it is needed.
   However, because the wp-admin/admin.php file is one big <?php ?> tag and I don’t
   know how to add the HTML code to the PHP file without getting header return errors.
   This is what I need to know how to do.
 * I’ve tried adding it to the CSS and the admin-header.php as you suggested and
   it doesn’t work.
 * Thanks again,
    Rick.
 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [20 years ago](https://wordpress.org/support/topic/adding-html-to-php/#post-399699)
 * Okay, the problem is that admin.php doesn’t stand alone. It’s just the opening
   part of the page. The actual Dashboard page is index.php. It includes admin.php,
   which sets up a bunch of stuff, then calls the admin-header.php, which starts
   the actual webpage. One of the things admin-header.php does is to include the
   wp-admin.css linkage, so any CSS that you want to do will work IF you put it 
   in wp-admin.css. So if it doesn’t work, then I don’t know what to tell you. Your
   CSS is wrong. Simple as that, really.
 * The short of it is that you CAN’T add code to admin.php like that. Not that code,
   anyway. The header is not in admin.php, it’s in admin-header.php and that’s all
   there is to it.
 * Are you using some plugin that modifies the dashboard? Like the Tiger Admin thing
   or something?
 * Also, if you have the admin page in a frame, then you would really want the scroll
   to apply to the frame, no? Not to the admin page itself.

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

The topic ‘Adding HTML to PHP’ is closed to new replies.

## Tags

 * [html](https://wordpress.org/support/topic-tag/html/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [scroll](https://wordpress.org/support/topic-tag/scroll/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 3 participants
 * Last reply from: [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * Last activity: [20 years ago](https://wordpress.org/support/topic/adding-html-to-php/#post-399699)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
