I am having a custom query that calls in pages in an array like so:
<?php
$args = array(
'post__in' => array( 2, 7, 9, 11, 13 , 15, 17 ),
'post_type' => 'page',
'orderby' => 'menu_order',
'order' => 'ASC'
);
$the_query = new WP_Query( $args );
while ( $the_query->have_posts() ) : $the_query->the_post();
?>
Is it still possible to target single pages of the array to have page specific alterations of the code, i.e.
<?php if(is_page(7)) { ?>
// do something
<?php } else { ?>
// do something else
<?php } ?>
inside this query or do I have to query every page in a a separate query?
I am using this query to put together multiple pages into one template (front-page.php) in order to have a onepaged layout, i.e. all content on one page, so I would like to use conditions inside the loop for clarity in my code.