Working around use_codepress error in WordPress 3.0

May 27, 2010

Site traffic reports indicate that some visitors to ThesisLab who use the theme’s built-in Custom File Editor have sought an answer to error messages that look something like this:

Fatal error: Call to undefined function use_codepress() in /ANY_OLD_DIRECTORY/public_html/wp-content/themes/thesis_XX/lib/admin/admin.php on line XX

In most cases, the answer is that your version of WordPress is too old. The Codepress function was included in WordPress as of version 2.8; an older version of WP won’t have it, and any call for it will go unanswered (as in ‘undefined function’). The answer then, would be to upgrade WordPress and you’d be good to go.

However: Thesis users who are adventurous early adopters of WordPress 3.0 beta are running into the same kind of error message when they attempt to use the Custom File Editor. The reason in this instance is that the use_codepress function is now deprecated in WordPress 3.0, and the reason for that is that the 3.0 download badly needed to go on a diet. Some things had to get the axe, and CodePress was first or second on the list.

What does this mean? Let’s start with what it doesn’t mean: It doesn’t mean that the Custom File Editor is unusable under WP 3.0. The editor itself works fine. What you won’t be able to do, however, is to use syntax highlighting. There is a line in the Thesis core file admin.php which calls for syntax highlighting using CodePress, but since that is no longer available in WP 3.0, the call goes unanswered and the editor gets borked.

So until Thesis architect Chris Pearson and the DIYthemes crew devise a new approach for highlighting (and I have every confidence that they will), here’s a temporary workaround:

Use your FTP program and your favorite plain text editor to navigate to and open admin.php (the path is thesis_17 (or thesis_16, if you’re using that version)/lib/admin/admin.php).

Comment out the line that calls for syntax highlighting by placing two forward slashes just before it. Example:

// if (use_codepress()) add_action('admin_print_footer_scripts', 'codepress_footer_js');

The line number at the end of the error message will tell you which line to comment out in admin.php. If you’re running Thesis 1.7, that should be line 46 42 (thanks, Greg); if you’re using Thesis 1.6.x, that should be line 57.

As an alternative approach for users who may be leery of editing a core Thesis file, or who just don’t seem to be ‘getting’ the instructions above: I have prepared pre-edited versions of admin.php for download. These files already have the line in question commented out; all you need to do is delete your default admin.php (located at lib/admin/admin.php) and upload the pre-edited version in its place.

Make sure that you download the correct version of the file for your version of Thesis:

This should keep you rolling until a permanent solution is released.

While awaiting a true fix for the use_codepress situation, Thesis users in need of syntax highlighting can make use of desktop plain text editors. Several of these are free:

Windows users may want to look at Notepad++ or the more powerful jEdit.

Mac users can avail themselves of the no-longer-supported but still available Smultron (which I use), the above-mentioned jEdit (which runs on Macs as well as Windows), or the popular TextWrangler.

Users of any of these plain text editors will need to use an FTP (file transfer protocol) program to access the file, and then use the text editor to edit the file. Folks unfamiliar with using FTP clients can benefit from the section FTP: Transportation for Your files section of this page.

Update, July 7:

The Thesis 1.7 download at the official download area has been updated with a new admin.php file to address this issue.

{ 117 comments… read them below or add one }

1 marc May 28, 2010 at 12:56 pm

Thanks a lot for writing about this. I had been looking for a solution to this problem for hours! You should be compensated by M. Pearson for fixing his stuff!!!

Reply

2 Philip Barron May 28, 2010 at 6:47 pm

Very glad it helped! :-)

Reply

3 Mathdelane May 29, 2010 at 2:50 am

Brilliant! Thanks for these tips. I’m glad I was able to find this for a client’s site I’m working on.

Reply

4 Philip Barron May 31, 2010 at 10:42 am

Glad this helped!

Reply

5 Athenee May 31, 2010 at 7:29 am

Thanks for your ‘easy to follow’ directions!

Reply

6 Philip Barron May 31, 2010 at 10:42 am

You’re welcome!

Reply

7 Emil May 31, 2010 at 11:50 am

Thanks this worked perfectly

Reply

8 Greg Rickaby May 31, 2010 at 8:04 pm

Great tip! BTW: The code comment out is on line 42

:)

Reply

9 Philip Barron May 31, 2010 at 8:31 pm

Grazie! :-)

Reply

10 Adam Baird June 1, 2010 at 6:11 am

Great stuff Philip. Thanks for the tip.

Reply

11 Prince Vasquez June 2, 2010 at 8:05 pm

You saved my life :) Thanks a million!

Reply

12 Mika June 6, 2010 at 4:58 am

Thanks a lot for this!

Reply

13 Alex Weber June 6, 2010 at 9:33 pm

Thanks! This fixed my issue.

Reply

14 Don Gilbert June 17, 2010 at 1:26 pm

It looks like Chris Pearson at least considered the fact that CodePress might not exist, because he added a few lines above where the error occurs this code:


if (function_exists('use_codepress'))

Don’t know why he didn’t implement it each place he called CodePress though. But, instead of commenting it out, you can add the check again on line 41 and it will fix it as well. That’s probably what Chris will end up doing, so that CodePress will continue to work on WP 2.8-2.9.2 or later on if/when someone releases a plugin to reenable CodePress on WP3.0 and later.

Reply

15 Vaibhav Kanwal June 17, 2010 at 5:09 pm

Wow! Thats very helpful.
I had a client complaining of the Custom Editor not working after upgrading to WP 3.0

I never knew the solution was just a couple of clicks away. Came here from Google and it took less than 1 min.

Beautiful. Thanks for such a well written and detailed explaination to both the cause and solution.

Reply

16 Matt Cheuvront June 17, 2010 at 5:37 pm

Thank you for this. Just upgraded to 3.0 and was wondering what happened. Cheers!

Reply

17 Tracy June 17, 2010 at 9:23 pm

Tried the code but I still can’t access the custom file editor in the admin section. :(

Reply

18 Philip Barron June 17, 2010 at 9:57 pm

What version of Thesis are you running? Are you running WordPress 3.0? The only code to add would have been the two forward slashes to comment out the line in admin.php mentioned above. Did you add more than those two slashes?

Reply

19 Tracy June 17, 2010 at 10:23 pm

I’m running 1.6 and this happened after upgrading to wp 3.0. Yeah I did that code, I saw your post at diyforums. :) Unfortunately no go for 1.6 fix :(

Reply

20 Tracy June 18, 2010 at 2:09 am

Thanks Phillip I got it working after all! :) I have some depth perception issues due to a scratch on my eye and I had put on the line of code above. Ha! Thankfully I’m persistent and figure it out. Thanks again!

Reply

21 Raymond Parker June 17, 2010 at 9:54 pm

Can’t even find that line 42 code in admin.php

I would have thought these issues would have been addressed by now. It’s not as if WP 3.) hadn’t been announced and beta released.

Reply

22 Philip Barron June 17, 2010 at 9:58 pm

Did you try using your text editor’s search feature?

Reply

23 Raymond Parker June 18, 2010 at 7:27 pm

Thanks, I figured it out. Not sure what the result is.

Reply

24 Mitchell Rimland June 17, 2010 at 11:33 pm

I have one this to say. YOUR AWESOME !!!! and THANK YOU !!! ok two things !

Reply

25 JHS June 18, 2010 at 1:18 am

SWEET!! Worked perfectly! Thanks a million!

Reply

26 Rick Beckman June 18, 2010 at 4:32 am

Man, I wrote most of that code too (the Thesis code editor)… It’s a shame that WP ditched CodePress, but I understand. Code highlighting is for folks who know code anyway, and the battle cry of Thesis since the start was that you wouldn’t need to know a jot or tittle of code to have an amazing site. Syntax highlighting is neither here nor there in the copy pasta world of Thesis customization.

I’d imagine the pros, experts, and ninja among us are wise enough to never, ever, ever modify files using WordPress’ online editors for the simple fact that editing a local copy to upload via FTP ensures that should your modifications b0rk everything, you can quickly fix it. Nevermind the fact it’s a lot easier to copy a file over as a backup, if needed.

Reply

27 Tracy June 18, 2010 at 1:22 pm

Sadly some of my clients don’t have ftp or cpanel access due to sub hosting or whatever their reasoning is and make life a pain for me . It came in handy for those types. Guess they will have to wait it out… :)

Reply

28 Martyn Chamberlin June 18, 2010 at 12:19 pm

THANK YOU! I’m a totally non-php guy so I was about to contact my Web designer. But this fixed my issue. I love people like you.

Reply

29 Tom Schaal June 18, 2010 at 1:15 pm

this is absolutely awesome … thank you so much for writing about this so clearly and saving me a huge headache!

Reply

30 Swannie June 18, 2010 at 4:34 pm

works like a charm thanks so much

Reply

31 PMOI June 19, 2010 at 11:03 am

Thank you soooo much! I was so stressed out and this worked first time – you’re a legend.

Reply

32 Peter J. Coburn June 19, 2010 at 4:52 pm

Simply Brilliant! Appreciate not only the help but also the details & reasons behind the fix.

Reply

33 Michel J. Gagnon June 20, 2010 at 10:21 am

You made my day. That’s a great Father’s Day gift. Appreciated.
Cheers.

Reply

34 Kim Solga June 21, 2010 at 12:13 pm

As always, pbarron…..AWESOME! Thanks!

Reply

35 One3rdNerd June 21, 2010 at 2:02 pm

Nice heads up Philip, I haven’t ran into this issue yet, but hey their is a first time for everything…. ;) Keep up the good work.

Reply

36 James June 21, 2010 at 2:21 pm

+1 to the thanks for a well written, easy to understand piece. Very informative, and very useful.

Reply

37 Kevin Tan June 21, 2010 at 4:58 pm

Awesome man! This should work for me.

Thanks for this temporary workaround.

Reply

38 Dennis June 21, 2010 at 5:08 pm

I’m getting a blank white screen, no error message. I went in and even fixed line 42, still blank white page when i try to go in & use custom file editor.

I then de-activated a plugin, got the error message (about line 42), but STILL didn’t work. The line 42 fix is uploaded, and still not working with OR without the plugin.

Any ideas? I’m pulling out hair as I speak…uh, type

Thanks!

Reply

39 Philip Barron June 21, 2010 at 6:01 pm

Just for specific info: Which version of Thesis are you using? Which version of WordPress?

Also, have you tried deactivating all plugins?

Reply

40 Dennis June 21, 2010 at 6:07 pm

Thesis 1.7 and WordPress 3.0

I de-activated plugins, and re-activated them now…BUT…I now have the Custom File section working, but it seems like I lost a page in WP (can’t find in Pages section) and now all of a sudden my audio & video files aren’t working correctly!

he-e-elp

Reply

41 Philip Barron June 21, 2010 at 6:54 pm

Did you delete the page that seems to be missing? Did you look in the WordPress trash? Also, are you running any caching plugins?

Neither the use_codepress tweak nor any Custom File Editor issue should have had any effect on your use of audio and video files. I think this problem is a good candidate for the DIYthemes forums.

Reply

42 Dennis June 22, 2010 at 5:36 pm

Got it working – thanks. Seems that the audio/video problem was coincidental and works now. Thanks for the help!

Reply

43 Liz June 22, 2010 at 12:46 pm

Phillip – I’ve read a lot of your posts in the Thesis forums. Thanks for this. The syntax highlighter never worked for me anyway – did you have to enable it? I wish there was an easy fix to the “screw up your custom functions file and lose the blog” problem. I guess it’s use FTP, but I used to doing quick fixes via the editor window.

Reply

44 Philip Barron June 22, 2010 at 5:07 pm

If I remember correctly, Liz, I think the default for syntax highlighting was disabled, and you had to click that red button to enable it.

I blow up my sites via custom function errors several times a day. If you never hang up your site, I say you’re not working hard enough, lol.

Reply

45 Liz June 22, 2010 at 5:22 pm

Well that explains a lot.
1. I’m defintely working hard enough and,
2. I’ve managed to not see that red button despite spending hours in Thesis. Last time I berate users for not seeing the searingly obvious. Heck.

Reply

46 Gene June 22, 2010 at 6:22 pm

Good day. Phillip.
I have working with this issue for the last 3 day on the Call to error: undefined function use_codepress(). I need help. Here is where I went to try to solve this issue. I go to Filezilla and log in. I then went under the right hand side column to where it says Remote Site: And then I went to public_html. opened it and went to my domain. opened the domain public_html folder open. I then went below that box to the bottom right hand side box. To where is says admin.php right click and open. I then counted down 40 rows and found if (function_exists(‘use_codepress’))
41 rows wp_enqueue_script(‘codepress’);
42 rows //if (use_codepress()) add_action(‘admin_print_footer_scripts’, ‘codepress_footer_js’); to where I placed the // that are in the line. I then save it and said yes to Upload this file back to the server But do I check the box that says Finish editing and delete local file? I did not. Then filezilla uploads and the server registered the change. I deactivated all my plugins. I refresh my browser and wait 5 minutes or so. And then went into my dashboard and clicked on Custom File editor and I still got the same error. For line 42. What am I doing wrong. I looked at my server in Hostgator and I am using a Linux server. I am using Thesis 1.7 and Wordpress 3.0.

Thanks a Bunch -

Reply

47 Philip Barron June 22, 2010 at 10:38 pm

The steps you’ve taken sound correct, even though they have not yielded results for you.

Try this: Replace the file lib/admin/admin.php which you have now with this copy, which is for Thesis 1.7 and which has line 42 commented out.

Reply

48 Jim June 23, 2010 at 9:13 am

Phil, thanks much. We, too, just upgraded to 3.0. Your fix works like a charm. –Jim

Reply

49 Erin Brenner June 23, 2010 at 9:13 am

Thank you, thank you, thank you. I’m a word editor, not a code editor. But this not only made sense but worked!

Reply

50 Travis June 23, 2010 at 2:38 pm

I put the // in front of the code, but I’m still getting the error…

Reply

51 Philip Barron June 23, 2010 at 3:28 pm

Tracy and Liz below are right; you shouldn’t get the error if the correct line (in the correct file) has been commented out.

Reply

52 Tracy June 23, 2010 at 2:54 pm

Travis, are you sure you didn’t do what I did and put it on the similar code a line above the code that needs to be changed?

Reply

53 Liz June 23, 2010 at 2:58 pm

Travis – that sounds like Tracy is right. It’s impossible to get the error if you’ve really commented that line out as it won’t be being called. Take another look.
Liz

Reply

54 Daniel June 23, 2010 at 4:13 pm

Great post. Worked like a charm. I never really benefitted from the code highlighting anyway. I’m not sure it every worked right for me.

Reply

55 Travis June 23, 2010 at 4:24 pm

Wow, I tried it again on two more of my sites, but still the same error. Thanks for the feedback everyone….I’ll go through it all again with a fresh mind and see what happens.

Reply

56 John June 23, 2010 at 5:20 pm

Thank you for the great tip on saving the Custom file editor.
It worked perfectly for me. All the best.

Reply

57 Warner Blake June 23, 2010 at 5:41 pm

So wish I could report success like the others … but it’s not working for me!?
can i go back to 2. 9.2?

Reply

58 Philip Barron June 23, 2010 at 8:54 pm

Unless you backed up your site before the upgrade – both web files and database – rolling back to the previous edition of WordPress will be problematic.

Which version of Thesis are you running?

Reply

59 Warner Blake June 24, 2010 at 8:55 am

Thanks for your reply Phillip … and for attaching a revised admin.php file in one of the messages above … that Worked!

As to the question of returning to the previous WP, it seems that when DreamHost does the auto update, it makes an ‘old’ folder!

But I didn’t need to go there, thanks to you … and to all the others who joined in on this issue … though frustrating, i am liking this backstage tour of the WordPress/Thesis world.

Reply

60 Philip Barron June 24, 2010 at 9:11 am

Warner, I’m glad the file worked out for you. Sorry about the necessity of the ‘under the hood’ stuff. :-)

Reply

61 Rainbowsurfer June 24, 2010 at 6:47 am

I seem to be in the same boast as Warner Blake.

Have tried both methods puting in the \ at line 57 which didn’t work, then also downloaded the file you recommended earlier for thesis 1.6.

In Filezilla when I open the admin php file it shows that the fix is in place.

Everything else is working fine. Any other suggestions would be much appreciated. Do you think if I moved up to version 1.7 it would fix the problem.

Here’s the error message
Fatal error: Call to undefined function use_codepress() in /home/content/72/5204872/html/wp-content/themes/thesis_16/thesis_16/lib/admin/admin.php on line 57

Many thanks

Reply

62 Philip Barron June 24, 2010 at 9:17 am

Rainbowsurfer, if you’re using Thesis 1.6, then try replacing your admin.php (located at lib/admin/admin.php) with this one, which is for 1.6 and has line 57 already commented out.

Reply

63 Rainbowsurfer June 24, 2010 at 10:11 am

Thanks for getting back Philip I tried that again but still no joy.

I just can’t see where I’m going wrong on this as the admin php file on the local and remote site have the commented out text.

The only difference between the files is that the local file size is 8,309 and the remote 8,126. As I transfered the local to remote shouldn’t it be the same file size?

Reply

64 Rainbowsurfer June 24, 2010 at 10:17 am

Just looking at the permissions on the remote and it says 0604 when all the other php scripts say 0644 would that make any difference

Reply

65 Philip Barron June 24, 2010 at 11:14 am

That could have an impact; permissions for admin.php ought to be 644. Try changing permissions to that value.

Reply

66 Rainbowsurfer June 24, 2010 at 11:45 am

Unfortunately still the same

Reply

67 Philip Barron June 24, 2010 at 12:42 pm

I just visited your site, and I see that you have your Thesis folder nested inside of another Thesis folder.

/wp-content/themes/thesis_16/thesis_16/custom/custom.css

That is incorrect, and can lead to configuration problems. Not sure if this is the reason for the problem at hand, but it might be.

68 Warner Blake June 24, 2010 at 8:59 am

Perhaps .. at least you could use Phillip’s revised admin.php file that was attached to one of the comments above. (i don’t see right off how he attached a file to a comment? otherwise i’d send you my copy!

Reply

69 Heidi June 24, 2010 at 11:49 am

Thank you SO much! I was so frustrated by this … glad to have it back up and running!

Reply

70 Gene June 24, 2010 at 5:19 pm

Hey Phillip.
Thanks for all the advice and hard work you put into helping me out. Although it seems like i am one a million unable to solve this codepress issue. So i am going to take the website completely down and wait a couple of days and try a fresh install. Maybe then it will take. Take to you later.

Gene

Reply

71 Philip Barron June 24, 2010 at 8:22 pm

I can certainly understand frustration over not being able to solve a problem with the solution seemingly in hand. On the other hand, blowing up the site does seems a little like overkill (at this stage). If you decide that you’d like someone to take a look at your installation to see what the matter is, I’d be willing to discuss that; you can reach me via the contact form on this site. A few dollars would be involved, but not very many. :-)

Reply

72 nDee June 24, 2010 at 8:04 pm

I’m new to your site which I happened to stumble upon in my quest to solve this same issue. Just wanted to say, THANKS LOADS! I quiver and shake whenever there’s a “techie” issue and your clear explanation and instruction was spot on.

I’m officially a fan!

Now where is the “Donate” button? ;-)

Reply

73 Philip Barron June 24, 2010 at 8:23 pm

I see you found it. ;-) Thank you very much!

Reply

74 Rainbowsurfer June 25, 2010 at 3:50 am

Many thanks for all your help Philip, that’s what the problem was.

Reply

75 Philip Barron June 25, 2010 at 5:58 am

Excellent! Very glad it’s working for you.

Reply

76 Lisa June 25, 2010 at 3:51 am

Hi Philip,

I’m new to the world of wordpress and thesis and I think I’m having the same issue as one of your commentors, but I couldn’t quite understand it, so here’s what’s happening with me.

I’m running wordpress version 3.0 and thesis 1.7. Before I upgrade to v3.0 I would get a blank white screen both in my admin area and on my actual site but after the upgrade everything seemed to be working fine until I tried to go into the Thesis custom file editor. It’s completely blank. No error message or anything.

Any help would be much appreciated.

Cheers, Lisa

Reply

77 Philip Barron June 25, 2010 at 6:30 am

It’s hard to tell from your account whether this is one issue or two. A number of things could have caused the general ‘white screen,’ and if the use_codepress issue is involved, you really should be getting an error message.

The first thing I’d suggest is to apply the use_codepress tweak for Thesis 1.7. If the issue persists after that, we’ll know that something else is involved. Could be a conflict caused by a plugin, in which case you’d want to deactivate all plugins as a test.

Reply

78 Lisa June 25, 2010 at 7:26 am

Hi Philip,

Thanks for getting back to me so quickly.

I’ve done the use_codepress tweak but that hasn’t changed anything, I’m still getting a blank screen with no error message. As for plugins, I don’t think I’m using any. I have looked through both the thesis area and the plugins area but I don’t see any plugins active.

Any ideas?

Reply

79 Philip Barron June 25, 2010 at 8:46 am

Any ideas?

None at the moment. Can you provide a link to your WordPress site?

Reply

80 Lisa June 26, 2010 at 9:38 am

Hi Philip,

http://www.quirkdesign.co.uk/wp-test is the address. It’s currently a work in progress so you’ll have to excuse the emptiness of it as I’m trying to switch from iWeb to wordpress.

Reply

81 Philip Barron June 26, 2010 at 10:06 am

Your social media icons aren’t powered by any plugins?

Also, have you checked any custom code you’ve placed in custom_functions.php?

82 Sarah June 25, 2010 at 8:57 am

This is fantastic. Totally needed a fix for this. Thanks!

Reply

83 Jen June 26, 2010 at 5:43 pm

Thanks for taking the time to write this – there is no way I would have figured it out on my own!

Reply

84 Lisa June 27, 2010 at 3:23 am

Hi Philip,

I’ve just had a look through the custom_functions.php file and I can’t find any reference to a plugin. I’m new to all this so I could just be missing something. Should I send you a copy of my custom_functions.php file?

Reply

85 Philip Barron June 27, 2010 at 6:48 am

Heh, we are approaching the point where a few dollars are involved, Lisa. I’m sending you an email in just a bit.

Reply

86 jim corbett June 28, 2010 at 4:34 pm

thanks for this.

Reply

87 Carol June 29, 2010 at 11:25 am

Utterly brilliant – Thanks a million for such great help… I am such an incompetent in all thing Tech but managed this easy-peasy!! Thank you. Carol

Reply

88 patrick June 29, 2010 at 1:54 pm

Thank you very much, Phillip.

Reply

89 Ava Zack June 30, 2010 at 3:49 am

Amazing. Thanks for that answer. And thanks SO much for that edited admin.php file!

Reply

90 Nancy Paul June 30, 2010 at 11:14 am

Thank you!!!! This worked perfectly. I am already in a bit over my head here so using the file you created was great for me. Thanks again!

Nancy

Reply

91 Jean July 1, 2010 at 1:37 pm

You are my hero!!!

Reply

92 Kharim July 2, 2010 at 8:46 am

Thanks very much for the help :)

Reply

93 Hypnosis Bob July 2, 2010 at 11:57 pm

Thanks, awesome! I haggled around for almost an hour with this problem until I found your site, and it took me less than 5 minutes to fix this!
Kind of upset that the THESIS team hasn’t sent out an email or something but instead let people figure this out themselves :-(

Reply

94 Warner Blake July 3, 2010 at 9:47 am

Good point Hypnosis Bob!

Reply

95 Cori July 3, 2010 at 8:14 am

Perfect! Thanks.

Reply

96 Gail July 5, 2010 at 8:39 am

I can not open the custom file editor to add the //. Any suggestions?

Reply

97 Philip Barron July 5, 2010 at 9:23 am

True, you cannot use the broken Custom File Editor to fix the broken Custom File Editor. ;-) Instead, follow my instructions above:

Use your FTP program and your favorite
plain text editor to navigate to and
open admin.php (the path is thesis_17
(or thesis_16, if you’re using that
version)/lib/admin/admin.php).

Alternatively, you can simply replace the admin.php with the edited copy for your version of Thesis; the download links are provided in the post.

Reply

98 Master Seducer July 6, 2010 at 5:27 am

That works excellent, thanks for the fix! I was already afraid that my site had been hacked or something like that. The Thesis team should have informed their customers of that (or even better, simply changed the code in the version they offer for download on their server) :-(

Reply

99 Ronald Redito July 7, 2010 at 11:35 am

I encountered the same error but I made a different solution.

I deleted that code on line 42, is that okay or would it affect my theme?

Reply

100 Philip Barron July 7, 2010 at 12:30 pm

That should be fine.

Reply

101 Robin July 7, 2010 at 5:38 pm

I just used your downloaded admin.php file and now my site is blank. can you help?

Reply

102 Philip Barron July 7, 2010 at 7:12 pm

If the site is the one that your name links to, it appears to be fine. Or did you mean another site?

Reply

103 Siddharth July 11, 2010 at 1:21 pm

Just modify.. by commenting out.. n upload it.. it ll be ok.. i think !!

Reply

104 elizabeth July 9, 2010 at 7:38 pm

wow, thank you SO much for sharing this! really appreciate it!

Reply

105 Justin July 15, 2010 at 1:09 pm

Many thanks for this. Couldnt understand why girlies code didnt work but bothered to read through the entire thread and found your excellent solution. Much appreciated. You rock!

Reply

106 Annet July 19, 2010 at 9:11 am

You’re an angel!!!

Reply

107 Unusual Marketer August 5, 2010 at 3:37 pm

HA!

Thanks a bunch! – just working on a new site, had to fiddle with the custom files, and that error was driving me nuts. Now it works again.

Reply

108 ColtonCat August 12, 2010 at 10:52 pm

Good solution, however, I took a different approach to the changes:

The existing code in admin.php is as follows:

if (function_exists('use_codepress'))
wp_enqueue_script('codepress');
if (use_codepress()) add_action('admin_print_footer_scripts', 'codepress_footer_js');

with the addition of two braces, it becomes:

if (function_exists('use_codepress')) {
wp_enqueue_script('codepress');
if (use_codepress()) add_action('admin_print_footer_scripts', 'codepress_footer_js');
}

to this, so if function_exists('use_codepress') returns false, the line

if (use_codepress()) add_action('admin_print_footer_scripts', 'codepress_footer_js');

is not executed. This change will make the theme work in 2.9 and less as well as 3.0 upward.

Reply

109 Elizabeth Campbell Duke August 29, 2010 at 11:19 am

Hey! Neither one of these fixes is working for me. When I tried to add the curly braces, I found that my code already had the second curly brace in place:
if (function_exists(‘use_codepress’))
wp_enqueue_script(‘codepress’);

if (use_codepress()) add_action('admin_print_footer_scripts', 'codepress_footer_js');
}

When I add the opening curly brace at the end of the first line, I end up with the following error which tells me there’s a problem from only inserting one brace:
Parse error: syntax error, unexpected $end in /home/myblog5555/public_html/wp-content/themes/thesis_17/lib/admin/admin.php on line 122

Help!

Reply

110 jt August 18, 2010 at 12:55 am

Hi Phillip,

I found your thread here by putting in this error string,
“Fatal error: Call to undefined function use_codepress()” when trying to access Custom File Editor to paste in code in both custom_function.php and custom.css.

I was trying to create a widget to place ads in thesis theme before my post and I have version 1.7. This error is messing my newbie head up! Any quick suggestions or workarounds?

Thanks!!
JT

Reply

111 Philip Barron August 18, 2010 at 7:59 am

If you got the codepress error while trying to use the Custom File Editor, JT, you should follow the instructions in the post at the top of this page.

Reply

112 jt August 18, 2010 at 10:15 pm

Man I tried to follow the directions to the letter went through FTP deleted my admin.php file and uploaded yours and here’s what I get when I try to access wp-admin,
Warning: require_once(./admin.php) [function.require-once]: failed to open stream: No such file or directory in /home/dwright/public_html/wp-admin/index.php on line 10
Fatal error: require_once() [function.require]: Failed opening required ‘./admin.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/dwright/public_html/wp-admin/index.php on line 10

Now I can’t edit my blog. I saved the original admin.php file that I deleted but I copied it and saved it as a text file. I read on how to convert it to a PHP file so that I can reload it but I haven’t been successful. For non-techie people that haven’t acquired the skills yet this simple solution you provided can be a headache!

I’m calling my hosting provider now in hopes of getting my blog back to where it was before I messed it up.

Reply

113 Philip Barron August 19, 2010 at 6:10 am

I can certainly understand your frustration, JT, and I believe you when you say that you tried to follow the instructions to the letter. However, your current problem was caused by your deleting and replacing the wrong file. Instead of removing the Thesis file that is located at thesis_XX/lib/admin/admin.php, as my instructions state, you removed a different file: a WordPress file with the same name but is located in a very different location (wp-admin/index.php).

The way to solve this current problem would be to download a fresh copy of your current version of WordPress, find its file admin.php that is located at wp-admin/index.php, and upload it into the wp-admin folder of your online WordPress directory. If you don’t want to attempt that, I imagine your host’s tech support would be happy to do it for you. Whether you do it or they do it, solving this will get your blog running again.

Reply

114 Elizabeth Campbell Duke August 29, 2010 at 11:22 am

Hey! When I tried the // at the beginning of line 42, I ended up with an error in another file on line 128:
Fatal error: Call to undefined function get_home_path() in /home/myblog5555/public_html/wp-admin/includes/misc.php on line 128

Ahhhhhh……

Has anyone else had this problem?

Thanks.

Reply

115 Philip Barron August 29, 2010 at 2:12 pm

I have to guess that you’re dealing with consequences from having added a curly brace (per your earlier comment) – which my fix doesn’t call for at all.

At this stage, I’d suggest simply deleting your admin.php (at lib/admin/admin.php) and replacing it with the pre-edited admin.php for Thesis 1.7. If the file shows up on your local computer as admin.php.txt, simply delete the .txt in the filename.

Reply

116 Elizabeth Campbell Duke August 29, 2010 at 3:14 pm

Hi Phil,
Thanks for the quick reply. I did actually remove the added brackets before doing the // comment.

I did manage to solve the whole issue by upgrading to Thesis 1.8.

Take Care,
Beth

Reply

117 Philip Barron August 29, 2010 at 3:58 pm

Glad you solved it!

Reply

Leave a Comment

{ 6 trackbacks }

Previous post:

Next post: