LeRoy LeRoy - 5 months ago 8
PHP Question

HTML to wordpress Converting Pages

I'm just a little confused with converting HTML to WordPress.

I have the following HTML pages "About us, Contact Us , Team" etc...

in WordPress do I have too create "About us.php, Contact Us.php , Team.php"
create a ContentPage.php and on wordpress I create the pages "About us, Contact Us , Team

I was also thinking of creating "About us.php, Contact Us.php , Team.php" then a tag should added where the user can change the text

Can't find a tutorial on a explanation on this.


No, you don't have to create separate php files for each page, instead, you can create a page.php file for all of your pages to be used when any page is displayed and to create pages from Wordpress' admin panel from Pages menu. If you have a page.php file in your template folder then WordPress will use this template to show every pages otherwise, the index.php file would be used. You can also create custom page templates for specific pages. An example/structure of a basic page template (without any formatting and HTML tags)

get_header(); // adds the header (header.php)
if (have_posts()) : while (have_posts()) : the_post();

    the_title(); // prints title of the page

    the_content(); // prints content/body of the page

endwhile; endif;

get_sidebar(); // adds the sidebar (sidebar.php)
get_footer(); // adds the footer (footer.php)

These are common structure and functions used for a template file but you should read on Codex for more information about creating a page template and add formatting/HTML according to your site's layout. Also, check Convert HTML to WordPress and Integrating WordPress with Your Website.