Help PHP, Wordpress page
- Started
- Last post
- 6 Responses
- benfal99
Hi. I need help. I got this message when I try to create a page on my Wordpress blog:
Parse error: syntax error, unexpected T_ENDIF in /home1/musixca/public_html/wp-co... on line 23
This is the code of page.php
- - - -
<?php /** * @package WordPress * @subpackage Default_Theme */ get_header(); ?>
<?php get_sidebar(); ?>
<?php while (have_posts()) : the_post(); ?><div class="post">
<h2 class="psot_title"><?php the_title(); ?></h2><div class="post_contents">
<?php the_content(); ?>
</div></div>
<?php endwhile; ?>
</div><?php endif; ?>
<?php get_footer(); ?>
- - - - - - -WHAT DO I NEED TO CHANGE OR CORRECT TO FIX THIS?
- fadein110
no if statement
- fadein110
<?php endif; ?> this isn't ending anything.
- benfal990
i tried to erase that line and it fuckup the layout
- fadein110
weird - is there an if statement opening in the header or sidebar files?
- benfal990
yes, check the code of the sidebar:
<?php
/**
* @package WordPress
* @subpackage Default_Theme
*/
?>
<div id="side_bar">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?><?php endif; ?>
</div>
- fugged0
based on the code, you've opened and closed the if statement in the sidebar include, but then try to close the if statement again in page.php. Unless there is another if statement that isn't included in your example code, then the issue is the extra endif in the page.php file.
If you were intending the endif in page.php to close the if statement from the sidebar, then you'd need to remove the endif from the sidebar include. But, I suspect this isn't the case. And if it is, it's poor form to open an if statement in an include and close it another file.