Title: HTML coding question?
Last modified: August 19, 2016

---

# HTML coding question?

 *  [monkeymartingmailcom](https://wordpress.org/support/users/monkeymartingmailcom/)
 * (@monkeymartingmailcom)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/html-coding-question/)
 * I am starting to put a lot more complicated HTML code into my posts. This cod
   is making it harder to make changes and fix problems. I separate the sections
   of a post into multiple pages. I tried shearing on Google but I don’t know what
   to search for.
 * **Example:**
    I have a table with some data. Instead of typing out all this information
   in the post I would like to have a separate HTML file that imports all of the
   code into my post. This way the post stays clean. I don’t want to just link to
   the information I would like it to be part of a signal post.
 * Thanks for your help

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

 *  [jamesbruno](https://wordpress.org/support/users/jamesbruno/)
 * (@jamesbruno)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/html-coding-question/#post-846728)
 * One thing I could suggest is making your own page templates. This way you can
   have all of the structure in the template and then just add your information 
   from wordpress.
 * [http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates](http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates)
 * Anthony
 *  [moronicbajebus](https://wordpress.org/support/users/moronicbajebus/)
 * (@moronicbajebus)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/html-coding-question/#post-846733)
 * I haven’t tested the following, but sounds like the basis of what you need in
   a plugin:
 *     ```
       /**
        * ... Plugin info
        *
        * Shortcode to include a file contents into the post when outputted.
        * [include src="internal/path/to/file.html"]
        */
   
       function shortcode_include_func($atts) {
       	extract(shortcode_atts(array(
       		'src' => '' // set the default to an empty string
       	), $atts));
   
       	if(!empty($src)){ // make sure $src is not an empty string
       		return file_get_contents($src); // return the file as a string
       	} else {
       		return '';
       	}
       }
       add_shortcode('include', 'shortcode_include_func');
       ```
   
 * A) I haven’t tested this at all.
    B) There needs to be error checking to make
   sure the file exists. C) The path will be confusing to most people. Perhaps best
   if it was to match the URL path instead of the internal path.
 *  Thread Starter [monkeymartingmailcom](https://wordpress.org/support/users/monkeymartingmailcom/)
 * (@monkeymartingmailcom)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/html-coding-question/#post-846738)
 * The page template is a good idea but most of the pages are going to be different.
 * I would like to create multiple HTML pages just like you can create multiple 
   CSS Style sheets. You have one main Style seat and import the rest like this
 * [@import](https://wordpress.org/support/users/import/) url(main.css);
    [@import](https://wordpress.org/support/users/import/)
   url(layout.css); [@import](https://wordpress.org/support/users/import/) url(color.
   css);
 * Is their a way to do the same thing with HTML
 *  [mrmist](https://wordpress.org/support/users/mrmist/)
 * (@mrmist)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/html-coding-question/#post-846761)
 * Not really, but you can do it in PHP.
 *  Thread Starter [monkeymartingmailcom](https://wordpress.org/support/users/monkeymartingmailcom/)
 * (@monkeymartingmailcom)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/html-coding-question/#post-846771)
 * How do I do this in PHP and can I put PHP in a post.
 *  [mrmist](https://wordpress.org/support/users/mrmist/)
 * (@mrmist)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/html-coding-question/#post-846844)
 * See [http://www.php.net/include/](http://www.php.net/include/)
 * You can’t normally write PHP code in posts, you’d need to either do it in templates,
   or use an exec php plugin which would let you put it into posts.
 *  Thread Starter [monkeymartingmailcom](https://wordpress.org/support/users/monkeymartingmailcom/)
 * (@monkeymartingmailcom)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/html-coding-question/#post-846886)
 * I found this [http://www.webhostingtalk.com/showthread.php?t=508687](http://www.webhostingtalk.com/showthread.php?t=508687)
 * I think I will have to live with all the HTML tags in my posts. Having to install
   a plug-in and run PHP will make life more complicated
 * Thanks for the help

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

The topic ‘HTML coding question?’ is closed to new replies.

## Tags

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

 * 7 replies
 * 4 participants
 * Last reply from: [monkeymartingmailcom](https://wordpress.org/support/users/monkeymartingmailcom/)
 * Last activity: [17 years, 7 months ago](https://wordpress.org/support/topic/html-coding-question/#post-846886)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
