I have a html template and I'd like to convert it to wp. I have a basic question regarding to the wp structure: my template is a one-page layout like this http://eriktailor.com/showcase/flatbook_preview_1.0/ebook-landing-page.html

How should I structure the different sections? I mean these would become pages or posts? I think pages would be a more relevant solution, but how can I get more different pages (instead of one) to my index.php?

I know it's a complex question what can't be answered in a few words, I was just hoping to get a point for how should I start. Actually I searched a lot for a one-page template wp convertion tutorial, but haven't found anything useful, that's why I'm asking here.

Thanks for your time.


Most probably you need to create a front-page.php because index.php should be used as failback for other templates or when the home page contain a stream of last posts, in your case, use front-page.php is better.

After that, choose post or pages depens on the content, but being a WP theme, most probably user already have posts or want to add posts (for news, blog sections, and so on) so if your theme do not handle posts at all I think it's not a great choice.

Just for example, the "Book review videos" section can be filled using post-format video and category "review" (or using a CPT "review")... "Chapters" section can be filled using a CPT "chapters"... "Messages from readers" section can be filled using a CPT "messages"... and so on.

These are only examples, stop some minutes and think about the structure, considering that your theme will be used by people that may already have content, and that in some cases want switch from your theme to another, try to make this passages more easy as you can. Also consider that specific CPT will be easier for users understand how add content for various sections. Only when you are sure create it.

Note that if you use posts (standard or CPT) you can make use of taxonomies (categories, tags or custom), and post format that will help you a lot to select post for the various section.

If you use pages, to select which page goes in a section and which in another, you have to create some theme settings or force users to call their pages with specific title... it's not a great idea.

(If you create a custom taxonomy you can assign it to pages, but WordPress users are familiar with taxonomies for posts, not for pages, and then post format are availble only for posts).

After that, pages are just posts with post type setted to page, you can query just like any other post type:

$args = array(
  'post_type' => 'page',
  'posts_per_page' => 2,
  'post_parent' => 0,
  'order_by' => 'title',
  'order' => 'ASC'
$query_for_two_parent_page = new WP_Query($args);

Exist also the function get_pages that is similar to get_posts but saves you to type 'post_type' => 'page' in the arguments.

As final note, instead of loading all the content when fron page load: think about load the content using ajax when content it's requested: e.g. when the related section is reached scrolling the page or e.g. for "Chapters" section load the requested chapter when the related link is clicked...

| improve this answer | |
  • Thanks for your answer, I really appriciate for taking your time to go in details. I think it's more than enough for a good start, I'll consider your suggestions, and try to implement in reality. Thanks again :) – user2556272 Oct 1 '13 at 17:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.