Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Basel Razouk
Basel Razouk
14,046 Points

Migrating a PHP/HTML/CSS site to Wordpress

Hi, I've created a website following the PHP/HTML/CSS tutorials which I would now like to migrate to wordpress. I have followed through the custom wordpress tutorials, however I'm still unsure what is the best way to transfer a custom php function to wordpress. For example, I have created some filtering and searching on one of the pages which I would like to replicate in wordpress without using a plugin. Does anybody have any tips as to what the best way of doing this is ? Thanks in advance.

1 Answer

Zachary Dahan
Zachary Dahan
2,392 Points

This depends of your actual website but in Wordpress you have few .php to personalize for create a theme.

First, here's the official doc about create a WP Theme :

  • The header of your website should be placed on a file called header.php. Basically, if you've done your website correctly with PHP, you've nothing to do, except Wordpressize it (like use wp_title(); in the <title> tag.)
  • The index.php correspond to your homepage. All missing template part redirect to this page. (i.e : if you doesn't have a page.php, Wordpress will use index.php instead.)
  • The style.css witch contain the template settings accessible here.
  • The page.php who contain the page template
  • The footer.php for the footer
  • And finally the single.php for articles.

If you've a page who use a particular architecture, maybe you should create a template file just for those kind of pages. For doing that, just specify this on the top of a page-yourcustumpage.php :

<?php
/*
Template Name: My Custom Page
*/

After that, you can choose in the WP Backoffice a model for your specific page. And WP will use you page-yourcustumpage.php template for this page only.

Your question is a way too large but, I hope I helped you. :)