• My wordpress developer has created a theme for me using static PHP files in the root folder of my theme eg. about-us.php, services.php etc… These files can only be updated and changed by modifying the HTML/CSS internally and externally.

    This throws up a number of issues. Namely, I can’t Yoast SEO these static pages because the headers are generic and fixed. I have to write all the HTML/CSS myself. I can’t edit these pages in the block editor. And finally I can’t seem to add duplicates of these pages to the site.

    Looking at regular themes, I see they just contain PHP code in the files in theme root. And presumably grab the HTML from the block editor.

    How can i go about fixing this mistake? And start editing these static pages dynamically? Or at least how do i duplicate a static file eg. my-analytics-post.php and have it show up as mysite.com/my-analytics-post/

    I’ve looked at the template hierarchy and i feel that what I’m doing ie. changing the slug on the post page. Should do the trick.

    Any thoughts or suggestions ? Should i get my dev to create dynamic pages from now on ?

    • This topic was modified 4 years, 6 months ago by Dbee.
    • This topic was modified 4 years, 6 months ago by Jan Dembowski.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Hello @dbee78,

    You can send me few public files and I will show you how to convert them.

    Yes, you are going good way, then you need to map page with the same slug and assign page template name.

    Just let me know.

    Thread Starter Dbee

    (@dbee78)

    Hi @egyptimhotep,

    Thanks. Can you just provide a link to a tutorial online pls? I’m not sure how sending you the files is going to help me.

    I’ve created a new file, ftp’d it to the server in theme root, created a new page, changed the slug to the file name eg ‘how-to-use-analytics-for-your-website’ for filename ‘how-to-use-analytics-for-your-website.php’. Then I’ve edited the file to reflect the

    Template Name: how-to-use-analytics-for-your-website

    But I still get the original landing page when i open

    mysite.com/how-to-use-analytics-for-your-website

    ?

    • This reply was modified 4 years, 6 months ago by Dbee.
    • This reply was modified 4 years, 6 months ago by Dbee.
    • This reply was modified 4 years, 6 months ago by Dbee.

    You need to create page template and assign it to yor page in admin.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    @egyptimhotep Please do not ask to have files sent to you or for off-forum contact. What your doing seems awfully close to using forums to seek work, and that’s not permitted. OK?

    Thread Starter Dbee

    (@dbee78)

    You need to create page template and assign it to yor page in admin.

    I’ve done that.

    @sterndata ,

    Can I send him a link with solution, like custom theme or plugin without asking his files?

    Sorry for breaking guidelines.

    • This reply was modified 4 years, 6 months ago by hellojesse.

    @dbee78

    I would just follow instruction for converting HTML/CSS theme into WP Theme. It must work.

    • This reply was modified 4 years, 6 months ago by hellojesse.
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Creating a theme using static pages in theme root …’ is closed to new replies.