0
votes

I have a working one page website I like to convert into multiple pages in wordpress.

I already successfully created a theme, converted the header, footer, css, js into wordpress, header.php, footer.php, and functions.php by following a tutorial.

Now I'm left with all my html content between the header and footer and want to cut that content up into multiple wordpress pages.

I can do "the_title(); wrapped in php" and make the content while loop to get the first page into a wordpress page, but from then I dont know what to do, to split the next lines of html into other wordpress pages.

1
Can you please explain your downvote? If I'm missing some obvious point, please tell me.Michael Winther

1 Answers

0
votes

You will need create some page templates for your theme. They will look something like this:

page-about.php

<?php
/* Template Name: About Page */
 get_header(); ?>

... about page content

<?php get_footer(); ?>

page-contact.php

<?php
/* Template Name: Contact Page */
 get_header(); ?>

... contact page content

<?php get_footer(); ?>

Then assign the template in the Wordpress admin, on Edit Page view to the corresponding templates you want to use. You select the template by the name you give it in the comments.

The actual file name of your templates matter. Some views in wordpress are assigned to templates simply by the name of the file. So you will want to use certain naming conventions like page-about.php. More info about templates: https://developer.wordpress.org/themes/basics/template-hierarchy/