WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Creating Pages with a Lot of Html Elements (3 posts)

  1. AK Ted
    Member
    Posted 1 year ago #

    I've setup a blog for my dad, and I'm trying to figure out the best way to recreate his spiritual/philosophical writings from many years ago. There's 13 "books" (pages) plus 3-4 other related pages that I'll be creating. They'll all be static pages. I've created the first book using WP's Page Editor (not fun for a lot of page content with lots of different elements, i.e., UL/LI, spans, divs, etc.), giving each element appropriate classes for later styling. My plan is to use the first book as a template (not WP Template) and copy/paste the content from the other books, keeping the HTML elements intact.

    Coding HTML in the Page Editor isn't fun at all, and indentations for code readability don't "stick" when pasted into the Editor from an outside source like Notepad, or in my case Dreamweaver. It seems to me the best option would be to code the HTML in static files (book1.html, book2.html), create a WP Page for each book, and have each HTML file somehow be "included" into each Page.

    So, my first question is, would that be the "best" way to do this, or is there a better way? I'm comfortable enough with HTML/PHP/webhost stuff that if I don't how to do something I can find out fairly painlessly. But I'm relatively new to WP, so I'm thinking that my way likely isn't the most efficient way.

    Second question: if my way isn't the best way, what would be? I don't need a step-by-step, more like a shove in the right direction.

  2. esmi
    Forum Moderator
    Posted 1 year ago #

    would that be the "best" way to do this, or is there a better way?

    If you using the same basic layout on each page, one possible approach might be to use a custom page template. If this was complimented with custom fields and/or custom shortcodes, it should greatly simplify the creation of these Pages.

  3. AK Ted
    Member
    Posted 1 year ago #

    Thanks, Esmi. I'd researched custom page templates a little beforehand, it seemed I'd need to create a separate template for each "book" (Page), create a new Page, then assign the correct template to that Page. Seems like a lot more work than manually copying the html from Dreamweaver and pasting it into a Page, loss of code formatting be damned. Custom fields and shortcodes seemed even harder, for my needs, though it's something I'd like to learn for future reference.

    In the end, I found a great little plugin, WP Include File which worked perfectly. It was as simple as

    [include file="my-file.html"]

    The outputted page looks identical to if I'd put the markup in the Editor - no loss of formatting. And it appears to work great on 3.4.2 even though it's only listed up to 3.1.4.

    Thanks again for your input.:)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.