Title: Change Function themes
Last modified: August 21, 2016

---

# Change Function themes

 *  [Fornob](https://wordpress.org/support/users/jawanet/)
 * (@jawanet)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/change-function-themes/)
 * hello
 * I have a little problem with my home-made themes.
 * when I check in with the theme of the check turns out there is a function that
   must be repaired although it can be used. below is the function that is considered
   less fit.
 * > INFO: includes/theme-widgets.php The theme appears to use include or require.
   > If these are being used to include separate sections of a template from independent
   > files, then get_template_part() should be used instead.
   >  **Line 20: require_once(
   > $jseo_widgets_dir . $jseo_widgets_file);**
 *     ```
       <?php
   
       /*------------------------------------------------------*/
       /* Loads all the .php files found in /includes/widgets/ directory */
       /*------------------------------------------------------*/
   
       	$preview_template = _preview_theme_template_filter();
   
       	if(!empty($preview_template)){
       		$jseo_widgets_dir = WP_CONTENT_DIR . "/themes/".$preview_template."/includes/widgets/";
       	} else {
           	$jseo_widgets_dir = WP_CONTENT_DIR . "/themes/".get_option('template')."/includes/widgets/";
           }
   
           if (@is_dir($jseo_widgets_dir)) {
       		$jseo_widgets_dh = opendir($jseo_widgets_dir);
       		while (($jseo_widgets_file = readdir($jseo_widgets_dh)) !== false) {
   
       			if(strpos($jseo_widgets_file,'.php') && $jseo_widgets_file != "widget-blank.php") {
       				require_once($jseo_widgets_dir . $jseo_widgets_file);
   
       			}
       		}
       		closedir($jseo_widgets_dh);
       	}
   
       ?>
       ```
   
 * I hope there are provide clues…
 * Tanks you brother.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/change-function-themes/#post-5020818)
 * Themes submitted to wordpress.org are not allowed to use `include` or `require`
   in their code.
 *  Thread Starter [Fornob](https://wordpress.org/support/users/jawanet/)
 * (@jawanet)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/change-function-themes/#post-5020921)
 * Ok, please help me to change the above code and the same function
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/change-function-themes/#post-5020924)
 * I’m sorry but I have no idea what that code snippet is intended to do. Where 
   did you get it from?
 *  Thread Starter [Fornob](https://wordpress.org/support/users/jawanet/)
 * (@jawanet)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/change-function-themes/#post-5020967)
 * In the theme of my own, I try to use get_template connect hard part, what you
   want to see my themes?

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Change Function themes’ is closed to new replies.

 * 4 replies
 * 2 participants
 * Last reply from: [Fornob](https://wordpress.org/support/users/jawanet/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/change-function-themes/#post-5020967)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
