• Resolved staru

    (@staru)


    hi, i started a new site and the homepage page width is 1200 px, i would like the article to have the global style width to 1000px (for the header, and also for article+sidebar).
    I know how from where to change them, but i want the width size to be different for homepage(+navigation pages), and different for post article.

    For the header i change this line of code from header.php

    <div style="width:1200px; height:auto; display: block; margin:0px auto;">

    And for the article + sidebar i change the style.css on line 265

    .page
    {
    margin: 0 auto;
    width: 1200px;
    }

    Did what I said make sense to you? Anyone can help?

    https://craftedforus.com/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Andrew Bartel

    (@andrew-bartel)

    Try this:

    <?php
    if ( is_front_page() ) {
    $width = 1200;
    } else {
    $width = 1000;
    }
    ?>
    <div style="width: <?php echo $width; ?>px; height:auto; display: block; margin:0px auto;">

    Thread Starter staru

    (@staru)

    Worked like a charm!

    (also, i changed the width from css to 100% to work properly)

    Thank you very much, i really appreciate your quick reply!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Conditionally change the width of global style’ is closed to new replies.