i have a single theme i use in my wordpress but i want to change the css of my ‘ contents div ‘ manually using php this is currently what i’m trying to do:
<div id="main" class="site-main">
<div class="content" style="<?php if (is_page('Contact Us'){ echo 'width: 870px;'; } ?>">
<div class="lft">
<?php if(have_posts()) : ?>
<?php while ( have_posts() ) : the_post() ?>
<div class="horizontal-divider">
<h1><?php the_title(); ?></h1>
</div>
<?php the_content(); ?>
<?php endwhile; ?>
<?php endif; ?>
</div>
<div class="rgt">
<?php
get_sidebar();
?>
</div>
</div>
</div>
<?php get_footer(); ?>
as you can see this line:
<div class="content" style="<?php if (is_page('Contact Us'){ echo 'width: 870px;'; } ?>">
is where i’m trying to change the size of the div to 100% using php but i keep getting this error:
Parse error: syntax error, unexpected '{' in C:xampphtdocswpaacowp-contentthemesaaco-themeindex.php on line 4
You have forgot to close
if
condition.you are missing a ) behind Contact Us+
fixed line:
Looks like you have a typo in your code. You’re missing a
)
in your if statement. You want that line to be:Bracket missing…
Thanks.