admin管理员组文章数量:1122826
I did a quick search on here and Google and can't really find something helpful. This question here doesn't fit my bill either.
I create websites for small business/startups/persons that rarely change content. With my HTML/CSS/PHP
knowledge I prefer to build the static pages from scratch so that I can control every single aspect of it (I am aware I could write WP themes but I see it rather redundant and an overkill).
I simply don't like to use WP unless I actually need a CMS
, not a website builder.
For my clients who need a blog with a sort of latest news section (or other content), I prefer to setup a WP in a sub-directory and use custom PHP
scripts based on WP API
to grab posts and media in the manner I like in my HTML pages.
It may be a bit tedious, but I find the results pleasing for me.
Is there something wrong with this approach? Or any ideas how to improve it, without using WP for powering the full site?
I did a quick search on here and Google and can't really find something helpful. This question here doesn't fit my bill either.
I create websites for small business/startups/persons that rarely change content. With my HTML/CSS/PHP
knowledge I prefer to build the static pages from scratch so that I can control every single aspect of it (I am aware I could write WP themes but I see it rather redundant and an overkill).
I simply don't like to use WP unless I actually need a CMS
, not a website builder.
For my clients who need a blog with a sort of latest news section (or other content), I prefer to setup a WP in a sub-directory and use custom PHP
scripts based on WP API
to grab posts and media in the manner I like in my HTML pages.
It may be a bit tedious, but I find the results pleasing for me.
Is there something wrong with this approach? Or any ideas how to improve it, without using WP for powering the full site?
Share Improve this question edited May 4, 2020 at 5:30 Brooke. 3,8931 gold badge27 silver badges34 bronze badges asked Jan 31, 2017 at 7:46 Ahmed MohamedAhmed Mohamed 213 bronze badges 5- I personally think this is a good idea. We're handling most of smaller projects his way also, good to see that somebody out there has the similar idea :-) – Marko Jezernik Commented Jan 31, 2017 at 14:12
- I'm glad I see someone sharing my ideas :) Do you have any issues with this approach on your projects? – Ahmed Mohamed Commented Jan 31, 2017 at 14:15
- No issues so far. We build a static website in the root folder and if blog or webshop are needed we usually add them as subdomains. Everything works smoothly. I personally think that WordPress might be a bit too much for smaller companies sometimes – Marko Jezernik Commented Jan 31, 2017 at 14:18
- That is exactly my reasoning and approach. Good to know it is working smoothly, and best of luck with your projects. – Ahmed Mohamed Commented Jan 31, 2017 at 14:21
- Best of luck to you too! – Marko Jezernik Commented Jan 31, 2017 at 14:26
5 Answers
Reset to default 0The reason to follow WP standard is for another DEV to pick it up later, or to transfer it without issue.
The problem is content. I could easily make a site from pages regardless of your plugins/themes if the database was set up in WP. But you are saving content differently so now I have to convert the data to WP tables, write rewrite rules and 301's. That is a lot of overhead.
Why not do it all in WP to begin with? Your client might want to move, and you could help them, making yourself look like a champ.
I think move wordpress is good Idea, Here you can build theme and then you are able to use other feature of CMS.
+you are able to manage your meta tags for SEO. +You can easily integrate social and shearing plugin +Google Analytics integration on single modification +Maintenance and modification is easy for you +You can extend website feature anytime when you want. +Many More
Hope this will help you.
I believe this all depends on who the developer is, what kind of server performance you have, etc.
If absolute speed is needed, your hosting is shared hosting and your pagespeed results show that server response needs improvement, and/or you have strong belief that static .html pages is best for SEO, I would say yes it is good to have wordpress serve the blog only in a separate directory.
If you have a server that can handle the load of Wordpress and all the speed optimization measures (there's no server response issues), I'd say it's better to handle all page changes within wordpress generated pages/posts as it's easier and more efficient to use the wordpress dashboard to edit content.
If a small WordPress website is experiencing performance issues then it's been built incorrectly or likely leveraging too many poorly coded plugins or themes attempting to do too much, which, if it's a small site, means they're probably unnecessary. I'm regularly involved in the building of small to medium WordPress sites that have Google Pagespeed scores in the high 90s.
However, I do understand what you're asking and there's nothing 'wrong' with your idea. Personally, I'd build in WordPress as that's my preference but if your preference is something different, then there's no reason why, if you have the capability, you can't do it otherwise.
One thing I would ask is, as you're already using WordPress as your Content Management System for some content, why not just use it for all of the content? Let your clients manage their content in WordPress and then use your scripts and the API to pull the content into the static pages you're building. Have them populate pages, and posts and then just pull them as needed into the static site.
I've seen this before and it's essentially a Headless WordPress implementation, like what's referenced here:
https://www.smashingmagazine.com/2018/10/headless-wordpress-decoupled/
and also something similar here:
https://spinupwp.com/gatsby-headless-wordpress/
A few months ago I was involved in a budgeting plan for an enterprise level site and part of that plan was using WordPress as a Headless CMS to manage the content that would be displayed in an entirely custom coded web application and site. So really, it's not unheard of at all.
What you are describing is called Headless WordPress or Decoupled WordPress and is becoming a more common method of using WordPress with static sites.
More sites are utilizing a Node front or want to use a static site generator to build static HTML with something like Gatsby. You may have also heard of the JAMstack which can be used with WordPress. Here's a Smashing Magazine article on JAMstack and WordPress.
You'll also find some helpful tips from the WordPress VIP team on Headless WordPress including avoiding writes to the database and gracefully handling request failures. If you are doing a GET request each time the page is loaded but the content doesn't change often you may want to look into a method to generate static files from WordPress or at least make sure you are caching the requests.
本文标签: Installing WordPress in a subdirectory with static HTML sites
版权声明:本文标题:Installing WordPress in a subdirectory with static HTML sites 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736282151a1926551.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论