Support » Themes and Templates » a simple “if…else…” – conditional tags-question

  • Resolved buntstift

    (@buntstift)


    hello,

    somehow i made nearly all themes work like i wanted them to do, sometimes using the conditional tags.
    but somehow this time my brain seems to be not working, i am producing php-errors.

    it is a very simple “condition”, though:
    it takes place in “archive.php”.

    if category 10 is displayed, the posts should be displayed via excerpt.
    if any other category is displayed, the posts should be displayed with their whole content.

    i tried several things like

    <?php if ( is_category(10) ) {
    echo '<?php the_excerpt(); ?>';
    } else {
    echo '<?php the_content(); ?>';
    }
    ?>

    but that didn’t work.

    can someone give me a the right piece of code ?

    thank you in advance!
    buntstift

Viewing 1 replies (of 1 total)
  • Thread Starter buntstift

    (@buntstift)

    sorry, i already have the answer.

    <?php if ( is_category(10) ) { ?>
    <?php the_excerpt(); ?>
    <?php } else { ?>
    <?php the_content(); ?>
    <?php } ?>
Viewing 1 replies (of 1 total)
  • The topic ‘a simple “if…else…” – conditional tags-question’ is closed to new replies.