2016-10-01 69 views
1

我是wordpress的初學者,我發現了很多創建小部件的插件,但我想創建一個自定義文本和RSS小部件,就像每個WordPress安裝附帶的小部件一樣。它允許用戶將文字,視頻,圖片,自定義列表等添加到他們的WordPress網站。我應該爲此做些什麼。如何創建自己的基本WordPress小部件

+2

請檢查該網址爲您的問題 - https://jainsagar.wordpress.com/2016/08/05/how-to-create-your-own-basic-wordpress-widgets/ –

+0

@jonrsharpe這是關於我的小工具,我想創建自定義請支持我們瞭解更多 –

+0

@animuson請支持我們從社區獲得更多答案。我想了解更多關於此的請支持我們,因爲我是初學者。 –

回答

1
//Put This code in themes -> function.php 
register_sidebar(array(
    'id'   => 'custom-widget', 
    'name'  => __('Custom Widget', $text_domain), 
    'description' => __('This is custom widget.', $text_domain), 
)); 

//After place code to function.php you can see your widget in your dashboard widget. 

//Place This code where you display your widget 
if (function_exists('dynamic_sidebar') && 
    dynamic_sidebar(sprintf('custom-widget', $i)) 
) 
+0

如果您想顯示小部件,則使用最後的代碼,否則使用此代碼。 – ImBS

+1

感謝您的支持 –

+0

您的需求是通過我的代碼完成的嗎? – ImBS

相關問題