Bu widget değilki ama. Wp-admin/bileşenlerde gözükmez bu. Önce bir adet widget oluşturmanız lazım. Aşağıdaki linkteki widget yapısını inceleyin. Kendinize göre düzenleyin. Yapamazsanız tekrar yazarsınız.
https://github.com/wpexplorer/my-widget-plugin/blob/master/my-widget-plugin.php
https://github.com/wpexplorer/my-widget-plugin/blob/master/my-widget-plugin.php
Hocam verdiğiniz linkteki kodları widget.php diye bir dosya açtım içerisine yapıştırdım.
Functions.php'ye şu kodları yapıştırdım fakat herhangi bir şey olmadı yardımcı olur musunuz ?
// The widget class
class My_Custom_Widget extends WP_Widget {
// Main constructor
public function __construct() {
/* ... */
}
// The widget form (for the backend )
public function form( $instance ) {
/* ... */
}
// Update widget settings
public function update( $new_instance, $old_instance ) {
/* ... */
}
// Display the widget
public function widget( $args, $instance ) {
/* ... */
}
}
// Register the widget
function my_register_custom_widget() {
register_widget( 'My_Custom_Widget' );
}
add_action( 'widgets_init', 'my_register_custom_widget' );