Author Topic: PHP wiz wanted  (Read 2687 times)

Offline Goatboy

  • Friends
  • The Pantheon
  • **
  • Posts: 1329
    • View Profile
PHP wiz wanted
« on: June 26, 2009, 01:49:23 PM »
Alrighty... so I'm starting a new website based on Wordpress. I'm also using Thesis theme, which is a theme/framework for Wordpress that allows you to do a lot of neat stuff.

I'm trying to use this piece of code to replace the standard Blog Title and Blog Tagline text with a header image:

Code: [Select]
/* Custom Header Image */
function add_header_image () {
echo "<a href=\"http://www.yourblogurl.com/\" title=\"Your Blog Title\">
<img src=\"THE-URL-OF-YOUR-LOGO-GOES-HERE\" alt=\"Your Blog Title\" height=\"170\" width=\"528\" style=\"border:0px\" />
</a>";
}
add_action('thesis_hook_after_title', 'add_header_image');

When I add it to the php file it needs to go in to work... it works!
Quite literally, it works as long as I use the code as it's presented with fake urls and text.

But as soon as I change the 'Your Blog Title' or 'www.myactualwebsite.nl', it breaks and it gives me the following error:
parse error, unexpected T VARIABLE, expecting ',' or ';'

This happens on the line containing 'echo'. I've tried again and again being careful not to touch the syntax that shouldn't be changed, but I haven't been able to pull it off.

I've done some searching and found some examples of this kind of code going wrong and a full stop or something missing or being in the wrong place. Unfortunately I'm not familiar with PHP at all. I'm hoping someone here is!

Is it a bad piece of code to begin with?
Daikini of the House Goat, the First of His Name, The Unmilked, Queen of the Meadow, The Chickens and the Pigs, Queen of the Field, Nibbler of the Great Grass Sea, Protector of the Wub, Lady Regent of the Seven Barns, Breaker of Fences and Mother of Ducklings.

Offline Taith

  • Friends
  • Cogniscenti
  • **
  • Posts: 481
  • Nommer of Worlds
    • View Profile
Re: PHP wiz wanted
« Reply #1 on: June 26, 2009, 02:59:24 PM »
Try URLs other than yours.

Also try breaking the single echo statement up into one per HTML tag. That might help narrow down exactly where your problem is.
DC Universe Online (EU PC): Psilance, Psion Hero, Noctirian, Sorcerer Villain
Neverwinter: Theron Dios, Control Wizard (Beholder)
Star Trek Online: Eric@TaithZero
SWTOR: Tarkanian, Sith Assassin (Progenitor) (Inactive)

Offline Goatboy

  • Friends
  • The Pantheon
  • **
  • Posts: 1329
    • View Profile
Re: PHP wiz wanted
« Reply #2 on: June 27, 2009, 07:37:23 AM »
Gah... I was using a plugin inside Wordpress to edit the php file, but it automatically stripped some code so it all broke.
Shame as the plugin is used by loads of people who are on Thesis... back to Dreamweaver editing for me. ;-(

Ta for the suggestions though. =D
Daikini of the House Goat, the First of His Name, The Unmilked, Queen of the Meadow, The Chickens and the Pigs, Queen of the Field, Nibbler of the Great Grass Sea, Protector of the Wub, Lady Regent of the Seven Barns, Breaker of Fences and Mother of Ducklings.