tags:

views:

47

answers:

2

I am trying to display a WordPress post on the homepage of a site. It is reporting the following error:

Parse error: syntax error, unexpected '=' in /home/####/####/####/####/wp-content/themes/oceanswaves/home.php  on line 105

<?php query_posts(‘p=143′); if(have_posts()) : the_post(); ?>
<?php the_content(); ?>
<?php endif; ?>

Thank you

+3  A: 

If this is literally copy & paste out of your file, then you've somehow gotten a curly quote, which I believe would cause that error in PHP. Look closely at:

query_posts(‘p=143′)

The character before p is NOT a ' so rewrite it as:

query_posts('p=143') 

and try again.

I think you somehow have curly quotes on both ends of the argument. The only legit quoting characters are ' and " -- are you using MS word to write your code?

Erik
Erik
I'm not using MS Word to write my code, Dreamweaver. It is copied and pasted from the website above. Thanks so much for your help.
Jeremy Person
Yes, I see it on his site now that I followed the link. He has 'smart quotes' or whatever its called turned on so WP is making fancy quotes inside his code. Have to keep an eye out for silliness like that :)
Erik
A: 

For interest's sake, you can make any Page (note, not a Post) the front page of your site through the admin dashboard. Visit Settings -> Reading -> "Front page displays."

Adam Backstrom