Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New Coder
    Join Date
    Jul 2009
    Posts
    78
    Thanks
    2
    Thanked 0 Times in 0 Posts

    if statement to change content div size

    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 Code:
    <?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
    Last edited by aliceinwonderla; 01-03-2012 at 10:04 PM.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •