WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Show HTML files in WordPress (6 posts)

  1. trubdor
    Member
    Posted 2 years ago #

    Greetings Forum Members!

    I would like to display a large amount of HTML files within an existing wordpress theme. I have only recently started using wordpress but do have experience writing PHP programs. I realize there are two versions of wordpress(wordpress.com and wordpress.org).
    Can this be done? If so I assume it would be done in a wordpress.org installation. I do have wordpress.org loaded on a site hosted by 1and1.com. I am using wordpress 3.3.

    Would each HTML page have to be loaded as a wordpress page?
    I have seen a plugin called HTML Import 2.0. Is this what I need?

    Since I am new to wordpress, I am not sure if HTML gets displayed inside wordpress or wordpress posts & pages get displayed by HTML(that is HTML generated by a PHP program).

    I am hoping someone understands what I am saying. Any direction would certainly be appreciated. Thank You.

  2. vtxyzzy
    Member
    Posted 2 years ago #

    In general, the content of WordPress Pages or Posts is HTML and it is formatted and displayed by a PHP template file that inserts the content into surrounding HTML to create the display.

    The HTML Import 2 plugin will insert HTML files into either Pages or Posts. I have used it on a couple of sites with good results.

    The only problem I found was that the version I used (don't remember the version no.) did not replace internal links with WP links. Instead, it generated a list of redirects to go into the .htaccess file. In my case, there were hundreds of pages and thousands of images, so the redirects were thousands of lines.

    Rather than suffer the performance hit for that many redirects, I wrote a Perl script that took the redirect statements and used them to replace the links in the HTML. Then I re-imported the HTML using the plugin.

  3. trubdor
    Member
    Posted 2 years ago #

    Thanks for the reply,

    I don't think the HTML Import 2 plugin is going to be practical for what I want to accomplish. I tried to upload a 1000 pages. It loaded them into the wp_posts table but there was a side effect. I could not get back into the Pages via the dashboard. I had to re-buld wp_posts with less records. I was then able to get back in. HTML Import 2 is probably OK for less pages.

    As an alternative I know an Iframe tag will display another document within wordpress. This might have possibilities but it looks like I have to figure out how to make it work with wordpress because it looks like it messes up the page - the sidebar disappears in the Twenty Ten theme.

    Another option I have been trying is to use PHP code to create dynamic pages. I just need to figure out how to modify .htaccess to get the correct URL's.

    Thank You.

  4. vtxyzzy
    Member
    Posted 2 years ago #

    Depending on how your HTML pages are organized, you could try to upload groups of pages smaller than 1000.

  5. trubdor
    Member
    Posted 2 years ago #

    Thanks for the suggestion.

  6. trubdor
    Member
    Posted 2 years ago #

    I resolved my dilemma in a different manner.
    As I mentioned I was new to wordpress and not sure how to proceed.
    I simply created a dynamic process using a custom php program
    that built each page "on the fly". I believe all Ecommerce type
    sites work this way. Thus, as the visitor makes a request for a
    specific product, the related product code and information is
    passed back to the same application in a query string and the program then runs a query to retrieve the requested information.

    In a situation where someone might want to display 100's or 1000's
    of existing .html files within wordpress, you would either have to load
    them into wordpress. I believe the HTML Import 2 plugin could work if
    you loaded small numbers of them instead of all them at once.

    The other method I considered was to use inline frames. If you place
    your href links within a Iframe, the html will load within the Iframe
    which of course is within wordpress.
    This is different than having a link to one your htm files from within a regular wordpress post. The link would cause the html file to overlay your wordpress window or open in another browser window but outside of wordpress - not what you want.

    The other consideration with using Iframe to display a lot of external html files is that they may not be too SEO friendly.

    Buona Fortuna!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags