开发者

WordPress: Display Single Post

开发者 https://www.devze.com 2022-12-31 00:07 出处:网络
I am trying to display a WordPress post on the homepage of a site.It is reporting the following error:

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(); ?>
开发者_JS百科<?php the_content(); ?>
<?php endif; ?>

Thank you


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?


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."

0

精彩评论

暂无评论...
验证码 换一张
取 消