Wednesday, January 18, 2023
HomeWordPress Developmentphp - Displaying generated HTML inside a Wordpress website

php – Displaying generated HTML inside a WordPress website


So I have already got a WordPress website, that has a theme and all the pieces (do not want tutorial on theme creation, it’s achieved). It has been up for awhile. I need to combine into it some HTML pages {that a} course of I’ve generates to allow them to be seen on-line. Now I may simply dump them in a subfolder and hyperlink to them, however they might not have the feel and appear of the remainder of the location, or our branding, or any navigation again to the remainder of the location. Not optimum.

All of the information are actually easy HTML, which means they’ve a construction like this (there isn’t a type of template or fluff within the information, simply the content material).

<html>
<head>
    <title>...</title>
    <hyperlink />
</head>
<physique>
    <h1>...</h1>
    
    ...
    
    <p>...</p>
</physique>
</html>

Now I do not need one thing that imports the HTML information, as there’s 750+ and counting of them, which might actually muddle issues up, and I additionally simply need to have the ability to add and unpack a zipper if there’s modifications to the generated information (by no means going to edit these pages instantly by way of WordPress). So it isn’t actually a one-time conversion of static HTML into WordPress however an ongoing course of.

So what I determine I must do I write some type of plugin that intercepts the requests to the HTML pages, extracts the title, any linked stylesheets/scripts and the contents of the physique tag and wraps the present theme round it. I appeared for if one may exist, however nothing like this appears to. The issue for me is although I’ve some PHP expertise, I actually haven’t any expertise with WordPress plugins like this. I’m searching for tips about how one can go about making an attempt to do that. Learn how to greatest strategy making a plugin like this. Can anybody with some WordPress plugin expertise level me in the proper route to get me happening the code?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments