• Hey! Trying to have a different width for my content on my index and single.php.
    I want to use 2 sidebars on my index and only 1 on the single.php and widen content for that page.

    I have sidebar thing worked out just need detailed help on how to have two directives for the content styling, single and index.

    Thanks!

Viewing 1 replies (of 1 total)
  • Assuming your main content area currently uses something like <div id="content">, try changing it to:

    <?php $content_width = 'narrow';
    if( is_single() ) $content_width = 'wide';?>
    <div id="content" class="<?php echo $$content_width;?>">

    That should produce <div id="content" class="narrow"> on every page except single post pages – which should have <div id="content" class="wide">.

    Next, edit your stylesheet and remove any reference to width on #content. Instead, add the width setting to a .narrow class and add the single post’s content width to a .wide class.

Viewing 1 replies (of 1 total)

The topic ‘Different content width for index and single’ is closed to new replies.