• <style type="text/css" media="screen"><?php if (is_page('1')) { ?>
    @import url( "<?php bloginfo('stylesheet_directory'); ?>/style-1.css" );<?php } ?></style>
    <style type="text/css" media="screen"><?php if (is_page('2')) { ?>
    @import url( "<?php bloginfo('stylesheet_directory'); ?>/style-2.css" );<?php } ?></style>
    <style type="text/css" media="screen"><?php if (is_page('3')) { ?>
    @import url( "<?php bloginfo('stylesheet_directory'); ?>/style-a.css" );<?php } ?></style>
    <style type="text/css" media="screen"><?php if (is_page('4')) { ?>
    @import url( "<?php bloginfo('stylesheet_directory'); ?>/style_a.css" );<?php } ?></style>
    <style type="text/css" media="screen"><?php if (is_page('5')) { ?>
    @import url( "<?php bloginfo('stylesheet_directory'); ?>/style_a.css" );<?php } ?></style>

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter tokyolife

    (@tokyolife)

    Sorry, first-time support poster… can you help me shorten the code above? thank you!

    syncbox

    (@syncbox)

    That’s a good question and exactly what I am looking for, too. Anyone? How do you indicate multiple pages using

    if (is_page())

    where you might have the same arguments for a range of pages?

    just to follow up, the solution is to use:

    if (is_page(1) || is_page(2) || is_page(3)) {arguments}

    not sure if this was answered elsewhere or not.

    I can’t get seem to get this working, keep geting a parse error, is this the correct way to write it ?

    if (is_page(1) || is_page(2) || is_page(3)) { ?>

    <?php include (TEMPLATEPATH . “/pagetpl.php”); ?>
    <?php } ?>

    According to the Codex:
    http://codex.ww.wp.xz.cn/Conditional_Tags#A_PAGE_Page
    it should be is_page(‘3’) – simple quotes…

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

The topic ‘shorten multiple is_page code?’ is closed to new replies.