我試圖從一個非WordPress的靜態主頁(index.html)使用按鈕啓動一個WordPress的網站。從索引啓動Wordpress網站
index.html將爲用戶提供一個選項,讓他們將他們的電子郵件聯繫信息或重定向到我單擊「Enter」按鈕時創建的WordPress網站。
當標準wordpress index.php文件位於站點根目錄下時,WordPress站點工作正常。當我用我自己的index.html文件(使用按鈕和聯繫碼)替換此文件時,我無法啓動wordpress index.php文件。我改名爲原來的WordPress的index.php來indexWP.php,我這裏使用的代碼建議調用文件從我的新的index.html文件:A button to start php script, how?
<form action="indexwp.php" method="get">
<input type="submit" value="Enter">
</form>
當我用上面的,它給了我一個404頁當我點擊Enter時未找到錯誤。
原來的WordPress的index.php看起來像這樣(更名爲indexwp.php):
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define('WP_USE_THEMES', true);
/** Loads the WordPress Environment and Template */
require('./wp-blog-header.php');
我是小白,所以我懷疑它的東西,我與上面的示例代碼曲解。
我寧願打自己的頭真的很難用自己的斷手不是使用一個網頁,不需要的「輸入」網頁...如果事情,殺死的用戶體驗。 – ppeterka
在WordPress中創建一個頁面並將其分配爲首頁。或者只是創建'home.php'並定製它;完成。點擊此處查看更多信息http://codex.wordpress.org/Template_Hierarchy – elclanrs
Enter用於進入Wordpress網站,因爲它在施工時受到密碼保護。索引。html應該是一個獨立於wordpress的單獨而簡單的頁面,所以我不必在wordpress中爲臨時主頁處理header/nav/footer抑制。 – David