i need to make some change on file that is save on inc/classes on my template.
The file is
<?php
class TheWorld_Tabs_Widget extends WP_Widget {
function __construct() {
// Set up the widget options.
$widget_options = array(
'classname' => 'widget-theworld-tabs tabs-widget',
'description' => __( 'Display popular posts, recent posts and tags in tabs.', 'theworld' )
);
// Create the widget.
parent::__construct(
'theworld-tabs', // $this->id_base
__( '» Tabs', 'theworld' ), // $this->name
$widget_options // $this->widget_options
);
}
function widget( $args, $instance ) {
extract( $args );
// Output the theme's $before_widget wrapper.
echo $before_widget;
?>
<ul class="tabs-nav">
<li class="active"><a href="#tab1" title="Popular"><i class="fa fa-thumbs-up"></i></a></li>
<li><a href="#tab2" title="Latest"><i class="fa fa-clock-o"></i></a></li>
<li><a href="#tab3" title="Comments"><i class="fa fa-comment"></i></a></li>
<li><a href="#tab4" title="Tags"><i class="fa fa-tag"></i></a></li>
</ul>
<div class="tabs-container">
<div class="tab-content" id="tab1">
<?php the_widget( 'TheWorld_Popular_Widget', 'title=0&show_date=1&limit=5' ); ?>
</div>
<div class="tab-content" id="tab2">
<?php the_widget( 'TheWorld_Recent_Widget', 'title=0&show_date=1&limit=5' ); ?>
</div>
<div class="tab-content" id="tab3">
<?php the_widget( 'WP_Widget_Recent_Comments' ); ?>
</div>
<div class="tab-content" id="tab4">
<?php the_widget( 'WP_Widget_Tag_Cloud' ); ?>
</div>
</div>
<?php
// Close the theme's widget wrapper.
echo $after_widget;
}
/**
* Displays the widget control options in the Widgets admin screen.
*
* @since 1.0.0
*/
function form( $instance ) {
?>
<p><?php _e( 'No need to setting anything for this widget.', 'theworld' ); ?></p>
<?php
}
}
And i need to change to
<?php
class TheWorld_Tabs_Widget extends WP_Widget {
function __construct() {
// Set up the widget options.
$widget_options = array(
'classname' => 'widget-theworld-tabs tabs-widget',
'description' => __( 'Display popular posts, recent posts and tags in tabs.', 'theworld' )
);
// Create the widget.
parent::__construct(
'theworld-tabs', // $this->id_base
__( '» Tabs', 'theworld' ), // $this->name
$widget_options // $this->widget_options
);
}
function widget( $args, $instance ) {
extract( $args );
// Output the theme's $before_widget wrapper.
echo $before_widget;
?>
<ul class="tabs-nav">
<li class="active"><a href="#tab1" title="Popular"><i class="fa fa-thumbs-up"></i></a></li>
<li><a href="#tab2" title="Latest"><i class="fa fa-clock-o"></i></a></li>
<li><a href="#tab4" title="Tags"><i class="fa fa-tag"></i></a></li>
</ul>
<div class="tabs-container">
<div class="tab-content" id="tab1">
<?php the_widget( 'TheWorld_Popular_Widget', 'title=0&show_date=1&limit=5' ); ?>
</div>
<div class="tab-content" id="tab2">
<?php the_widget( 'TheWorld_Recent_Widget', 'title=0&show_date=1&limit=5' ); ?>
</div>
<div class="tab-content" id="tab4">
<?php the_widget( 'WP_Widget_Tag_Cloud' ); ?>
</div>
</div>
<?php
// Close the theme's widget wrapper.
echo $after_widget;
}
function form( $instance ) {
?>
<p><?php _e( 'No need to setting anything for this widget.', 'theworld' ); ?></p>
<?php
}
}
I've put this on my child functions.php
require get_stylesheet_directory() . '/inc/classes/widget-tabs.php';
And then save on child-theme/inc/classes/widget-tabs.php
my edit file but i have error
Fatal error: Cannot redeclare class TheWorld_Tabs_Widget in /home/mysite/public_html/wp-content/themes/world/inc/classes/widget-tabs.php on line 0