I want to override the function “widget” in the inc/widgets/widget-popular-posts.php because I want the “recent” tab to be the first and active shown instead of the “popular” tab. I copied the original function widget( $args, $instance ) { … } to the file functions.php in the child theme and modified the following lines:
...
<ul class="nav nav-tabs">
<li class="active"><a href="#recent"><?php esc_attr_e( 'Recent', 'dazzling' ); ?></a>< /li>
<li><a href="#popular-posts"><?php esc_attr_e( 'Popular', 'dazzling' ); ?></a></li>
...
But that doesn’t work. I also tried to duplicate the whole directory structure inc/widgets/widget-popular-posts.php to the child theme and then modified the widget-popular-posts.php file, but that doesn’t work either. However if I modify the original theme it would work.
Any help?