我已经检查了这段代码几个小时,但找不到缺少的逗号、括号或引号等。我是 PHP 初学者,但我正在尝试 - 找到它的任何帮助都会很棒。我得到的错误是:
PHP Parse 错误:语法错误,第 235 行中的意外 $end of file in ...
这是我的代码:
<?php
$page = get_page_by_title( 'CSA' );
$page1 = get_page_by_title( 'Co-op Members' );
$page2 = get_page_by_title( 'Recipes' );
$page3 = get_page_by_title( 'FAQs' );
$page4 = get_page_by_title( 'Contact Us' );
$page5 = get_page_by_title( 'Home' );
if ( is_page($page->ID) )
{?>
<div id="page-bg" style="background: url('<?php bloginfo('template_directory'); ?>/images/green/page-top5.jpg') no-repeat scroll center bottom #244714 !important;">
<?php
}elseif ( is_page($page1->ID) )
{?>
<div id="page-bg" style="background: url('<?php bloginfo('template_directory'); ?>/images/green/page-top2.jpg') no-repeat scroll center bottom #244714 !important;">
<?php
}elseif ( is_page($page2->ID) )
{?>
<div id="page-bg" style="background: url('<?php bloginfo('template_directory'); ?>/images/green/page-top3.jpg') no-repeat scroll center bottom #244714 !important;">
<?php
}elseif ( is_page($page3->ID) )
{?>
<div id="page-bg" style="background: url('<?php bloginfo('template_directory'); ?>/images/green/page-top4.jpg') no-repeat scroll center bottom #244714 !important;">
<?php
}elseif ( is_page($page4->ID) )
{?>
<div id="page-bg" style="background: url('<?php bloginfo('template_directory'); ?>/images/green/page-top5.jpg') no-repeat scroll center bottom #244714 !important;">
<?php
}elseif ( is_page($page5->ID) )
{?>
<div id="page-bg" style="background: url('http://ycgrown.com/wp-content/uploads/2013/03/Cherry-Tomatoes.jpg') no-repeat scroll center bottom #244714 !important;">
<?php
}else{
?>
<div id="page-bg" style="background: url('http://ycgrown.com/wp-content/uploads/2013/03/Cherry-Tomatoes.jpg') no-repeat scroll center bottom #244714 !important;">
编辑:我添加了 PHP 标记,但仍然收到错误 - 以及进一步的想法?