Add content depending on page loaded

Assuming that you want to output content conditionally, depending on whether you are on a given set of static pages, by Page ID, you can simply wrap your code in an is_page() conditional.

To determine if the current user is logged in, you can use the is_user_logged_in() conditional.

For example

// Array of Page IDs
$page_ids = array( 2506,2516,2512,2513,2509,2515,2510,2508,2514,2511,2507 );

// If the current context is a static page with one of the above IDs
// and the current user is logged in
if ( is_page( $page_ids ) && is_user_logged_in() ) {
    // This is one of our pages
    // Do something
}

Or for the case in which the current user is not logged in:

// Array of Page IDs
$page_ids = array( 2506,2516,2512,2513,2509,2515,2510,2508,2514,2511,2507 );

// If the current context is a static page with one of the above IDs
// and the current user is NOT logged in
if ( is_page( $page_ids ) && ! is_user_logged_in() ) {
    // This is one of our pages
    // Do something
}