I need some help to solve a problem
I have created a widget with the following code
class Widget extends WP_Widget {
function Widget() {
$widget_ops = array('classname' => 'widget', 'description' => __( 'desc', 'Shah_khor' ) );
$this->WP_Widget('widget', __( 'widget', 'Shah_khor' ), $widget_ops);
}
function widget( $args, $instance ) {
extract($args, EXTR_SKIP);
//Some Code
}
function update( $new_instance, $old_instance ) {
//Some Code
}
function form( $instance ) {
//Some Code
}
}
add_action( 'widgets_init', 'mywidgets' );
function mywidgets() {
register_widget( 'Widget' );
}
It works perfect but I want to organize my functions file, so I decided to put this in a new file and then use require_once
require_once ( get_stylesheet_directory() . '/lib/widget.php' );
It works on the admin, but when I go to the frontend I get an empty page.
Do you have any idea how can I solve this?
Thanks advance