WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Warning: implode() [function.implode]: (19 posts)

  1. jeffqc
    Member
    Posted 4 years ago #

    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
    }}
  2. Mark / t31os
    Moderator
    Posted 4 years ago #

    And what happens if you switch theme?

  3. jeffqc
    Member
    Posted 4 years ago #

    this is a bug with the them but the problem is that i need this theme :(

  4. Mark / t31os
    Moderator
    Posted 4 years ago #

    What line is line 23 then?

  5. Joezy
    Member
    Posted 4 years ago #

    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.

  6. Mark / t31os
    Moderator
    Posted 4 years ago #

    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.

  7. resmyrranda
    Member
    Posted 4 years ago #

    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:)

  8. resmyrranda
    Member
    Posted 4 years ago #

    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.

  9. resmyrranda
    Member
    Posted 4 years ago #

    SUCCESS!! THANK YOU T31os_!!!

    What ya do is correct that line as instructed above the post_templates.php file, save, refresh, et walla:) whewwwwwww :)

  10. Mark / t31os
    Moderator
    Posted 4 years ago #

    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... ;)

  11. jeffqc
    Member
    Posted 4 years ago #

    t31os_ thank you problems solved

  12. traciknoppe
    Member
    Posted 4 years ago #

    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

  13. Mark / t31os
    Moderator
    Posted 4 years ago #

    Hi Traci,

    Can you provide the error message?

  14. craiger
    Member
    Posted 4 years ago #

    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.

  15. Mark / t31os
    Moderator
    Posted 4 years ago #

    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.

  16. jeffqc
    Member
    Posted 4 years ago #

    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)

  17. jrmcg1
    Member
    Posted 4 years ago #

    t31os_ 's advice worked for me too.

    NOTE: EDIT WITHIN YOUR HOSTING CONTROL PANEL!!!!!!!! it makes this so much easier.

    booyah.

  18. ukhealthjobs
    Member
    Posted 4 years ago #

    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

  19. ukhealthjobs
    Member
    Posted 4 years ago #

    I did it!! Very proud of myself. Changed as per instructions above through FTP.

    Sam

Topic Closed

This topic has been closed to new replies.

About this Topic