将html页面插入wordpress

我有一个html网站,其中包含美国每个县的信息页面。 我想把它转换成一个新的wordpress网站。 我可以一个接一个地做这个,但是当我对联盟代码或普通文本进行大规模更改时,我的问题就出现了。 我必须到每个页面并手动更改它。 但是有超过3000页,这将是耗时的方式。 我不想使用Iframes,但想知道是否有办法将html页面调用到wordpress页面,这是明智的。</ p>

我愿意创建一个页面 每个县或有一个页面上面有文字或按钮,每个县都列出,点击后会插入下面的信息。 我知道很多关于静态html编码但是我是php的新手。 </ p>
</ div>

展开原文

原文

I have an html site with a page of info for each county in the US. I want to convert this into a new wordpress site. I can do this one by one but my issue comes when I have mass changes to affiliate code or common text. I would have to got to each page and manually change it. but with over 3000 pages it would be way to time consuming. I dont want to use Iframes but would like to know if there is a way to call the html pages into the wordpress page that makes sense seo wise.

I am open to creating a page for each county or have one page with text or buttons on it with each county listed and when clicked will insert the info below. I know alot about static html coding but am new to php.

2个回答

If you dont want Iframes, I think there only remain two options. I don't know if they will work in WordPress though.

1. PHP Include

With the very simple PHP include() statement, you can include the old html files in your new website. If you have a HTML-file for example, name your file yourname.php and add this in the position you want your old page to appear:

<?php include(path_to_old_page/name.html); ?>

This will include the full old page, but the file needs to be on the same server.

2. AJAX

With JavaScript you can perform XHTTP-requests to load files from the server. This is easiest when using jQuery. Here you can use the $(selector).load(path_to_old_page/name.html) statement. This will load the file in the HTML elements to which the selector applies.

(The selector works the same as CSS selectors, see the w3schools page for more)

This will also include the full old page, when it is on the same server

dongpu5600
dongpu5600 对不起,但我不知道。 我对WordPress没有任何经验。 如果你正在编写网站,这可能会有所帮助,否则我将删除我的答案,因为它无用。
4 年多之前 回复
dousi1097
dousi1097 我会使用文本选项卡将此代码添加到wp页面
4 年多之前 回复



您也可以在WordPress中拥有静态页面。 就像你想创建一个名为“example”的新县一样,你可以通过输入标题“example”来创建一个名为“example”的新WordPress页面....现在来到内容。 只需复制页面内容(仅从您的静态网站“示例”县相关的html代码)并将该代码放在新创建的WordPress“示例”页面中。 确保在编辑器的“文本”选项卡中添加此html内容。 您的页面将使用所有现有数据创建...现在您可以查看此页面,并可以随时使用此页面的URL。 </ p>
</ div>

展开原文

原文

You can have your static pages in WordPress as well. Like if you want to create a new county named "example" you can create new WordPress page named "example" by entering title " example" .... now come to content. Just copy page content (only "example" county related html code from your static website) and place that code inside newly created WordPress "example" page. Make sure you add this html content inside 'text' tab in editor. Your page will be created with all your existing data ... now you can view this page and can use this page's URL where ever you want.

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐