This Forum Has Been Archived
*Click Here To Visit The NEW Forum*

 

 


New code error I can't figure out

Designing your own website? Need help? Ask your questions and share your favorite resources here... Tables, Forms, Color Scheme & Layout, Scripts, Programs & Resources

Moderators: angienewton, tknoppe, terrapin719, lisamariemary

New code error I can't figure out

Postby MichelleS » Thu Jun 11, 2009 9:34 pm

Hi all,
I know it's been forever since I've posted, but I've been around, and silently learning again. I've been working on a few projects and just ran into my first PHP coding error I can't figure out.

I am working on a blog site, and have been changing a few things around. I was doing pretty good, till I went to change a title from "top 10 web hosting" to "Work at Home Resources".

This is the error I'm getting: Parse error: syntax error, unexpected T_LNUMBER, expecting '(' in /home/tomorrow/public_html/wp-content/themes/HostingPress/functions.php on line 2

And this is the coding:

<?php
function work at home resources(){
include (TEMPLATEPATH . "/workathomeresources.php");}
function featured(){
include (TEMPLATEPATH . "/FeaturedNews.php");}
if ( function_exists('register_sidebar') )
register_sidebar(array(
'before_widget' => '',
'after_widget' => '',
'before_title' => '<h4>',
'after_title' => '</h4>',
));
?>

Okay, I made another change, and now have a third error. The other two errors are gone, so I know I'm working on the right line. Now I'm getting Parse error: syntax error, unexpected '-', expecting '(' in /home/tomorrow/public_html/wp-content/themes/HostingPress/functions.php on line 2 and the only thing I have change is line two, so that it now reads function work-at-home-resources(){

Is there a file somewhere that I am missing in editing?

I'm not exactly sure what I am forgetting to put back in, or what I'm leaving out on line 2. Any ideas or suggestions would be awesome!

Oh, and if your curious, and you want to see where and what I've been up to lately, you can check out our ranch blog

This was edited after I fixed one error and got a different one.
MichelleS
 
Posts: 4
Joined: Sun Apr 05, 2009 8:44 am
Location: Greeneville, TN

Postby terrapin719 » Thu Jun 11, 2009 10:38 pm

It looks like you've got something interfering with your theme. Switch to the default theme for a moment and see if your troubles go away before you get to frustrated over it.
User avatar
terrapin719
Elite Member
 
Posts: 1082
Joined: Thu Jul 07, 2005 2:15 pm
Location: Floating away.....

Postby scottcarey » Thu Jun 11, 2009 11:27 pm

You can't put '-' in the name of the function. It has to be the underscore '_' instead. PHP will interpret the dash as a minus sign. Replace the each '-' with '_' and I think that should solve it.
scottcarey
 
Posts: 1
Joined: Thu Jun 11, 2009 2:12 pm

Postby MichelleS » Sat Jun 13, 2009 6:47 am

Switch to the default theme for a moment and see if your troubles go away before you get to frustrated over it.


Already tried that, I can't even get to my WP Admin area.

Scott, I did try with the underscores, while I was trying to figure out what I did, and that didn't work either.

Guess I'm going to do this the hard way, and dl the theme to another site, and see if I can figure it out. Wish me luck!
[/quote]
MichelleS
 
Posts: 4
Joined: Sun Apr 05, 2009 8:44 am
Location: Greeneville, TN

Postby MichelleS » Sat Jun 13, 2009 7:07 am

well, I'm not sure why it didn't work the other night when I orginally posted my problem. But, I've got it all squared away now!

whew! I thought I really messed up bad, but I was on the right track! Now to finish project and get it switched over to this new theme full time lol

Thanks to those that responded and offered help.
MichelleS
 
Posts: 4
Joined: Sun Apr 05, 2009 8:44 am
Location: Greeneville, TN

Postby tknoppe » Sat Jun 13, 2009 7:34 am

Glad you got it fixed! What ended up being the exact problem?
User avatar
tknoppe
Elite Member
 
Posts: 1026
Joined: Sun Sep 14, 2008 11:36 am
Location: Missouri, USA

Postby terrapin719 » Sun Jun 14, 2009 1:14 pm

Yay! Glad you got it worked out in the end. Sometimes code is enough to make us all crazy ;)
User avatar
terrapin719
Elite Member
 
Posts: 1082
Joined: Thu Jul 07, 2005 2:15 pm
Location: Floating away.....


Return to HTML, Web Design & Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron