...

View Full Version : if statement to change content div size



aliceinwonderla
01-03-2012, 10:01 PM
Edited to add:
I may have posted this prematurely, it appears to be working on some pages but not others and I can't work out if it's a cache issue now or not.

__________________________________________________________________________________


i have an if statement to identify what page the user is viewing. if they're on x or y page, the main content will display at 1000px. if the user is on any other page it will display at 800px wide with a sidebar.

the statement seems to be working in as far as the sidebar only shows on every other page - but the content isn't resizing to 800px.

the url is www.aliciahannahnaomi.com - you'll need to log in to view the site as it's currently in maintenance mode.

the pages that should be affected with the sidebar and smaller content div are "shop" and most of the pages within the shop.

the code I'm using is:



<?php
$div="<div id='contentWide'>";
if (is_page('2')):
elseif (is_page('28')):
elseif (is_page('37')):
elseif (is_page('15')):
elseif (is_page('13')): ?>
<?php else : $div="<div id='contentSidebar'>";?>
<?php if( is_active_sidebar( 'widget-shopp' ) ) :?><div class="widget-area"><?php endif;
dynamic_sidebar( 'shopp' );
if( is_active_sidebar( 'widget-shopp' ) ) :?></div><?php endif;?>
<?php endif; ?>

<?=$div?>
<div <?php post_class(); ?>>
<?php get_template_part('format', 'page');?>
</div>
</div>



www.aliciahannahnaomi.com/wp-admin/
user: codingforums
pass: m@gpies



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum