Convert Wordpress theme to plain XHTML+CSS

给你一囗甜甜゛ 提交于 2019-12-04 22:27:08

问题


So there is a lot of posts on the internet about how to convert your XHTML+CSS theme to Wordpress, but I have a Wordpress theme and want to convert it (or un-convert it) back to just XHTML+CSS.

Has anyone done this before? Anyone know of any resources (tutorials etc.) that I can use to help me do this?

Thanks


回答1:


Wordpress renders html. If you want a static version of your wordpress site you could use Wget.

wget -l2 -r -p -k -E http://www.example.com/



回答2:


Visit the Wordpress web page in question, right click on the page and select view source. This will give you the XHTML. You can then find the CSS by going to the files linked in the header




回答3:


Let's open the source code with your fave editor & replace WordPress functions with some test texts. If there's an include or require statement, replace it with the destination file's contents.

On the other hand, you can run it on a server and just save the page as HTML. You'll have the static theme.




回答4:


You could also try this a plugin called Really Static, which generates static files for you.




回答5:


You could also do it the hard way and rip appart the php files (removing the

First would be header.php, then single.php (or page.php or whatever page style you are trying to copy) then the footer.php

This would allow you to do it without a webserver.




回答6:


I tried this:

wget -l2 -r -p -k -E http://www.example.com/

It works great as far as it goes, but it does not pull over images in the CSS File, so you'll need to ftp over or upload the theme files.

Also make sure you're wordpress site is using "Pretty Permalinks" so you don't end up with wacky urls like (http://www.example.com/index.html%3Fpage_id=2.html).

This might be a pretty good security measure as well. Try hacking a static site.



来源:https://stackoverflow.com/questions/645465/convert-wordpress-theme-to-plain-xhtmlcss

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!