Title: Warning: implode() [function.implode]:
Last modified: August 19, 2016

---

# Warning: implode() [function.implode]:

 *  Resolved [jeffqc](https://wordpress.org/support/users/jeffqc/)
 * (@jeffqc)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/warning-implode-functionimplode-1/)
 * ive this s line all around wordpress dashboard since ive install the new 2.9 
   version
    **Warning: file(/home/stripper/public_html/celebquebec.com/wp-content/
   home/stripper/public_html/celebquebec.com/wp-content/themes/metro_10/index-3_columns.
   php) [function.file]: failed to open stream: No such file or directory in /home/
   stripper/public_html/celebquebec.com/wp-content/themes/metro_10/tools/post_templates.
   php on line 23 Warning: implode() [function.implode]: Invalid arguments passed
   in /home/stripper/public_html/celebquebec.com/wp-content/themes/metro_10/tools/
   post_templates.php on line 23
 *     ```
       //This function scans the template files of the active theme,
       //and returns an array of [Template Name => {file}.php]
       if(!function_exists('get_post_templates')) {
       function get_post_templates() {
       	$themes = get_themes(); //an array of all themes in the /themes directory
       	$theme = get_current_theme(); //the current, active theme
       	$templates = $themes[$theme]['Template Files']; //a list of all the current theme's template files
       	$page_templates = array ();
   
       	foreach ((array)$templates as $template ) { //this loop returns all the "post templates"
       		$template_data = implode( '', file( WP_CONTENT_DIR.$template ));
       		$name = '';
       		if ( preg_match( '|Single Post Template:(.*)$|mi', $template_data, $name ) ) { $name = $name[1]; }
       		if ( !empty( $name ) ) { $post_templates[trim( $name )] = basename( $template ); }
       	}
       	return $post_templates; //return the array of Post Templates
       }}
       ```
   

Viewing 3 replies - 16 through 18 (of 18 total)

[←](https://wordpress.org/support/topic/warning-implode-functionimplode-1/?output_format=md)
[1](https://wordpress.org/support/topic/warning-implode-functionimplode-1/?output_format=md)
2

 *  [jrmcg1](https://wordpress.org/support/users/jrmcg1/)
 * (@jrmcg1)
 * [16 years, 1 month ago](https://wordpress.org/support/topic/warning-implode-functionimplode-1/page/2/#post-1319460)
 * t31os_ ‘s advice worked for me too.
 * NOTE: EDIT WITHIN YOUR HOSTING CONTROL PANEL!!!!!!!! it makes this so much easier.
 * booyah.
 *  [ukhealthjobs](https://wordpress.org/support/users/ukhealthjobs/)
 * (@ukhealthjobs)
 * [16 years ago](https://wordpress.org/support/topic/warning-implode-functionimplode-1/page/2/#post-1319463)
 * Help is needed please. I have just upgraded and get this message all over my 
   admin pages:
 * Warning: file(/home/ukh32946/public_html/wp-content/home/ukh32946/public_html/
   wp-content/themes/metro_10/search.php) [function.file]: failed to open stream:
   No such file or directory in /home/ukh32946/public_html/wp-content/themes/metro_10/
   tools/post_templates.php on line 23
 * Warning: implode() [function.implode]: Invalid arguments passed in /home/ukh32946/
   public_html/wp-content/themes/metro_10/tools/post_templates.php on line 23
 * I don’t see where I can edit this:
 * The problem is this line here, it’s setting an incorrect path.
    $template_data
   = implode( ”, file( WP_CONTENT_DIR.$template )); Try updating that to.. $template_data
   = implode( ”, file( $template )); Not sure it will help, but worth a shot i guess.
 * I would appreciate some assistance.
 * Sam
 *  [ukhealthjobs](https://wordpress.org/support/users/ukhealthjobs/)
 * (@ukhealthjobs)
 * [16 years ago](https://wordpress.org/support/topic/warning-implode-functionimplode-1/page/2/#post-1319464)
 * I did it!! Very proud of myself. Changed as per instructions above through FTP.
 * Sam

Viewing 3 replies - 16 through 18 (of 18 total)

[←](https://wordpress.org/support/topic/warning-implode-functionimplode-1/?output_format=md)
[1](https://wordpress.org/support/topic/warning-implode-functionimplode-1/?output_format=md)
2

The topic ‘Warning: implode() [function.implode]:’ is closed to new replies.

## Tags

 * [function](https://wordpress.org/support/topic-tag/function/)
 * [implode](https://wordpress.org/support/topic-tag/implode/)
 * [warning](https://wordpress.org/support/topic-tag/warning/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 18 replies
 * 8 participants
 * Last reply from: [ukhealthjobs](https://wordpress.org/support/users/ukhealthjobs/)
 * Last activity: [16 years ago](https://wordpress.org/support/topic/warning-implode-functionimplode-1/page/2/#post-1319464)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
