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, 3 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 15 replies - 1 through 15 (of 18 total)

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

 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/warning-implode-functionimplode-1/#post-1318973)
 * And what happens if you switch theme?
 *  Thread Starter [jeffqc](https://wordpress.org/support/users/jeffqc/)
 * (@jeffqc)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/warning-implode-functionimplode-1/#post-1319214)
 * this is a bug with the them but the problem is that i need this theme 🙁
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/warning-implode-functionimplode-1/#post-1319216)
 * What line is line 23 then?
 *  [joezy](https://wordpress.org/support/users/joezy/)
 * (@joezy)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/warning-implode-functionimplode-1/#post-1319304)
 * I’m getting the same problem since switching to 2.9 – get it with one theme but
   not others. I haven’t changed the theme that causes the error. Here’s the error
   message:
 * Warning: implode() [function.implode]: Invalid arguments passed in /home/mindwor1/
   public_html/wp-content/themes/agent_20/tools/post_templates.php on line 23
 * The theme in question seems to function properly, but this makes a real mess 
   of my dashboard and I’m concerned that there are other problems lurking in there
   somewhere that I haven’t discovered yet.
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/warning-implode-functionimplode-1/#post-1319308)
 * 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.
 *  [resmyrranda](https://wordpress.org/support/users/resmyrranda/)
 * (@resmyrranda)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/warning-implode-functionimplode-1/#post-1319331)
 * Hi JeffQC,
 * hm, I’m having the exact same issue with the exact same Theme. Since this is 
   a premium theme I really hate to dump it for a new theme (Metro 1.0). Were you
   able to resolve it and if so, could you share how, or anyone else please? Thank
   you:)
 *  [resmyrranda](https://wordpress.org/support/users/resmyrranda/)
 * (@resmyrranda)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/warning-implode-functionimplode-1/#post-1319332)
 * Interesting, looks like both themes in question here are Studiopress premium 
   themes. Metro and Agent. What to do… If I figure it out I’ll repost.
 *  [resmyrranda](https://wordpress.org/support/users/resmyrranda/)
 * (@resmyrranda)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/warning-implode-functionimplode-1/#post-1319333)
 * SUCCESS!! THANK YOU T31os_!!!
 * What ya do is correct that line as instructed above the post_templates.php file,
   save, refresh, et walla:) whewwwwwww 🙂
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/warning-implode-functionimplode-1/#post-1319334)
 * I just copied the code you provided, printed out the variables, the problem was
   quite evident..
 * You may want to pass the information along to the author, so he can fix the problem..
   if he’s not released an update already.
 * And you’re welcome… 😉
 *  Thread Starter [jeffqc](https://wordpress.org/support/users/jeffqc/)
 * (@jeffqc)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/warning-implode-functionimplode-1/#post-1319382)
 * t31os_ thank you problems solved
 *  [traciknoppe](https://wordpress.org/support/users/traciknoppe/)
 * (@traciknoppe)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/warning-implode-functionimplode-1/#post-1319420)
 * I’m having this exact same issue, and I did apply the fix t31os_ provided, but
   I’m now using version 2.9.1 and it’s not working. Cleared my cache, etc… and 
   still getting the error within the wp dashboard area only, not on the web.
 * Any other suggestions?
 * Thanks
    Traci
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/warning-implode-functionimplode-1/#post-1319421)
 * Hi Traci,
 * Can you provide the error message?
 *  [craiger](https://wordpress.org/support/users/craiger/)
 * (@craiger)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/warning-implode-functionimplode-1/#post-1319427)
 * We are quite aware of this 2.9 issue and had the resolution in our support forum
   the day 2.9 was released. If you are a Member you would have seen this.
 * Agent or Black Canvas:
 * {easy way}
    1. Find the Post Templates plugin in your Plugin manager and use 
   the update function to update it to the latest version.
 * OR…
 * {hard way}
    1. Download the latest version from the plugin repository
 * 2. Deactivate the Single Post Template plugin in your Plugin Manager via the 
   Admin panel.
 * 3. Delete the old version
 * 4. Upload or install the latest version (1.3)
 * 5. Reactivate the plugin
 * Metro theme:
 * 1. Download the latest version from the plugin repository.
 * 2. You MUST delete the post-templates.php file in the /metro_10/tools/ folder.
 * 3. Upload the new (1.3) post-templates.php file to the folder named in step 1.
 * That’s it.
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/warning-implode-functionimplode-1/#post-1319428)
 * > If you are a Member you would have seen this.
 * So i take it this problem relates to a premium theme then.
 * Lucky this forum’s support is free i guess.
 *  Thread Starter [jeffqc](https://wordpress.org/support/users/jeffqc/)
 * (@jeffqc)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/warning-implode-functionimplode-1/#post-1319429)
 * ive buy the highly custome template for Twitter from ebay.
    now the video doesnt
   not appear at the right of the page( aside the tweet)

Viewing 15 replies - 1 through 15 (of 18 total)

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

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: [15 years, 11 months 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
