Title: shorten multiple is_page code?
Last modified: August 18, 2016

---

# shorten multiple is_page code?

 *  [tokyolife](https://wordpress.org/support/users/tokyolife/)
 * (@tokyolife)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/shorten-multiple-is_page-code/)
 * <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](https://wordpress.org/support/users/tokyolife/)
 * (@tokyolife)
 * [19 years, 4 months ago](https://wordpress.org/support/topic/shorten-multiple-is_page-code/#post-516510)
 * Sorry, first-time support poster… can you help me shorten the code above? thank
   you!
 *  [syncbox](https://wordpress.org/support/users/syncbox/)
 * (@syncbox)
 * [19 years ago](https://wordpress.org/support/topic/shorten-multiple-is_page-code/#post-516724)
 * 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?
 *  [syncbox](https://wordpress.org/support/users/syncbox/)
 * (@syncbox)
 * [18 years, 11 months ago](https://wordpress.org/support/topic/shorten-multiple-is_page-code/#post-516737)
 * 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.
 *  [ringostar](https://wordpress.org/support/users/ringostar/)
 * (@ringostar)
 * [18 years, 7 months ago](https://wordpress.org/support/topic/shorten-multiple-is_page-code/#post-516778)
 * 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 } ?>
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [18 years, 7 months ago](https://wordpress.org/support/topic/shorten-multiple-is_page-code/#post-516779)
 * According to the Codex:
    [http://codex.wordpress.org/Conditional_Tags#A_PAGE_Page](http://codex.wordpress.org/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.

## Tags

 * [is_page](https://wordpress.org/support/topic-tag/is_page/)

 * 5 replies
 * 4 participants
 * Last reply from: [moshu](https://wordpress.org/support/users/moshu/)
 * Last activity: [18 years, 7 months ago](https://wordpress.org/support/topic/shorten-multiple-is_page-code/#post-516779)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
