PHP if statement not working
-
In my site I have two different sidebars, one for the Blog and one for the rest of the site.
The sidebars reside in php files named sidebar-blog.php and sidebar-standard.php.
Here is the code:
<?php if ( is_home( 'blog' )) : { // This is the blog sidebar get_sidebar( 'blog' ); } else { // This is the sidebar for website get_sidebar( 'standard' ); } ?>The following error appears when I try to access the Blog page:
Parse error: syntax error, unexpected ‘{‘, expecting ‘:’ in /home/graphic6/public_html/artist_site/wp-content/themes/doublechild/index.php on line 62
When accessing the other pages I get the blog sidebar.
(The homepage has no sidebar and is unaffected)
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘PHP if statement not working’ is closed to new replies.