• Resolved developstack

    (@developstack)


    Hello. I am trying to convert an HTML theme to a WordPress theme. I have created all the files necessary and added the codes. I added homepage code in frontpage.php file and about us page code in page.php. When I tried to make a contact page I’m confused about where can I add the code of contact page. I made a contact.php file and make a contact page through dashboard it redirects me about us page. Can anyone help me here? Thanks

    • This topic was modified 4 years, 11 months ago by Jan Dembowski.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Themes are generic and must handle all content that the user writes, not just certain ones (about, contact). See the Template Hierarchy for which templates handle the various requests. That means that page.php has to handle any Page written, not just the About page.
    Put your specific About content into a WordPress Page in the editor, and the page.php should display it, just like it displays any other Page, like Contact. The front-page.php should handle both choices of static page or latest posts on the home page.
    Most people use a plugin (with a shortcode or a block) for the Contact page, so that they can either save the information or have options of who it is sent to.

    Theme Developer Handbook

    Thread Starter developstack

    (@developstack)

    I tried to add the text and code in the text editor. and publish the page. But it shows me only the header and footer. Not the text which I added in text editor. I think maybe some functions or files are missing.

    Don’t put code in the WordPress editor.
    If your theme isn’t calling the_content(), then you won’t see it. The theme does all the work of showing the content from the database, but it is generic so that it works with all pages.
    Read the Theme Developer Handbook.

    Thread Starter developstack

    (@developstack)

    how can I solve this issue? Can you please help?

    No, I can’t write the theme for you. There are thousands of themes that you could use and just put the content into the editor, like most people do, and perhaps some Additional CSS (in the Customizer) to make it look like the original.
    Since you don’t understand how to write a theme, I suggest you pick one that is close and customize it.

    Thread Starter developstack

    (@developstack)

    Okay, thanks for suggestions and help. Really appreciate it.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Convert html to wordpress’ is closed to new replies.