• I am trying to make my images display smaller, but only when in category view. I have tried the code below, which is the best I can figure out, but it doesnt work. Any ideas how to make this work?

    '<?php if ($cat) { ?>
    <style type="text/css">
    .img_main {
    border-style: none;
    border:1px solid #E8E8E8;
    padding: 6px;
    margin-bottom: -10px;
    margin-top: -10px;
    width: 95px;
    height: 95px;
    }
    </style>
    <?php } ?>'

Viewing 1 replies (of 1 total)
  • It depends where you put that code(should be in your header). You could also try an echo statement like this:
    '<?php if ($cat) {
    echo <<<END
    <style type="text/css">
    .img_main {
    border-style: none;
    border:1px solid #E8E8E8;
    padding: 6px;
    margin-bottom: -10px;
    margin-top: -10px;
    width: 95px;
    height: 95px;
    }</style>
    END;
    } ?>'

    though I think that your code should do the same.

Viewing 1 replies (of 1 total)
  • The topic ‘Help with <?php if ($cat) { ?>’ is closed to new replies.