• So I there must be an association code to group Conditional Tags together.

    Here is what i got:

    <?php if ( is_page(‘1’) ) { ?>
    **CODE X**
    <?php } ?>

    <?php if ( is_page(‘2’) ) { ?>
    **CODE X**
    <?php } ?>

    <?php if ( is_page(‘3’) ) { ?>
    **CODE X**
    <?php } ?>

    its pretty anoying to have to re write code x over and over.

    i tried using &&:

    <?php if ( is_page(‘1’) && is_page(‘2’) ) { ?>
    **CODE X**
    <?php } ?>

    but that didnt work.

    There must be an easier way. Anyone?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello

    If you want all the pages to have the same content than you can just do:

    <?php if ( is_page() ) { ?>
    **CODE X**
    <?php } ?>

    That will affect all “Pages”

    If you want to do some pages one way and other pages different you can do:

    `<?php if ( is_page(‘1’) || is_page(‘3’) ) { ?>
    **CODE X**
    <?php } ?>`

    `<?php if ( is_page(‘2’) || is_page(‘4’) ) { ?>
    **CODE X**
    <?php } ?>`

    If you wanted to have the same content on a “Page” and single post you can do:

    `<?php if ( is_page() || is_single() ) { ?>
    **CODE X**
    <?php } ?>`

    Hope it helps. 🙂

    Thread Starter siounis

    (@siounis)

    my god thank you

    HIGHLY RECOMMEND they put this info in the conditional tages page.

    http://codex.wordpress.org/Conditional_Tags

    HIGHLY RECOMMEND they put this info

    Q: They? Who is they?
    A: “they” is us – you and I and every WP user. Please, feel free to login to the Codex and add any additonal info you consider useful for your fellow users 🙂

    Thread Starter siounis

    (@siounis)

    no doubt? wow. yah ill do that. i think..i duno how though- lol like wikipedia?

    EXACTLY like wikipedia

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Associated Conditional Tags’ is closed to new replies.