我不知道如何定義我的問題,即時通訊工作在我的自定義WordPress主題上,並且我已經在Wordpress管理中的常規設置中添加了自定義輸入字段,通過編輯.PHP和添加在一般列表中的新陣列,然後我創建在選擇-general.php一個新的TableRow:將wordpress添加到wordpress options-general.php
<tr valign="top">
<th scope="row"><label for="siteupdates"><?php _e('Site Updates') ?></label></th>
<td><input name="siteupdates" type="text" id="content"
"value="<?php form_option('siteupdates'); ?>" class="regular-text" ></>
<span class="description"><?php _e('Site news,updates,etc.') ?></span></td>
</tr>
和還添加一個div在header.php中其中i希望它顯示:
<div id="siteInfo">
<?php form_option('siteupdates'); ?>
</div><!--siteInfo end-->
然後我在wordpress數據庫中添加了新的查詢phpmyadmin('siteupdates')和everyth ing很好,因爲即時通訊非常新的PHP,我看過很多教程,發現這種方式對我來說是最簡單的。 現在我想這個輸入切換到一個文本字段,但是當我改變的HTML:
<tr valign="top">
<th scope="row"><label for="siteupdates"><?php _e('Site updates') ?></label></th>
<td><textarea name="siteupdates" type="text" id="content"
cols="50" rows="6" value="<?php form_option('siteupdates'); ?>" class="regular-text">
</textarea>
<span class="description"><?php _e('Site news,updates,etc.') ?></span></td>
</tr>
它看起來不錯,我看到文本框,而不是輸入,但我在它不能存儲數據。我在哪裏錯了?
從'wp-admin'文件夾編輯文件並不理想,因爲它們會在/升級WP安裝時破壞。 – Indranil 2011-12-19 18:38:11
即時通訊知道這一點,但我不知道其他方式來做到這一點,編輯functions.php是複雜的方式,如果你們中的一些人可以解釋我如何以適當的方式做到這一點。 – misticx 2011-12-19 18:48:52
你應該看看[添加你自己的選項頁面](http://codex.wordpress.org/Administration_Menus) – Indranil 2011-12-19 18:52:10