Met “is_page” is het mogelijk om te achterhalen welke pagina (of post) op dat moment geladen is in WordPress.

// When any single Page is being displayed.
is_page();

// When Page 42 (ID) is being displayed.
is_page( 42 );

// When the Page with a post_title of "Contact" is being displayed.
is_page( 'Contact' );

// When the Page with a post_name (slug) of "about-me" is being displayed.
is_page( 'about-me' );

/*
* Returns true when the Pages displayed is either post ID 42,
* or post_name "about-me", or post_title "Contact".
* Note: the array ability was added in version 2.5.
*/
is_page( array( 42, 'about-me', 'Contact' ) );

Hieronder een voorbeeld/manier om, als de content is geladen (maar nog niet zichtbaar), te controleren of bepaalde pagina(/post) is geladen. In dit geval maak ik gebruik van de “the_content” Filter

// Content is geladen. Nog niet zichtbaar:
add_filter( 'the_content', 'a3d_content_loaded' ); 
 
function a3d_content_loaded( $content ) { 
    // When the Page with a post_name (slug) of "about-me" is being displayed.
    if ( is_page( 'about-me' )) {
        // Doe iets met de content ($content)
	  return $content;	
	  } else {
    return $content;
    }
}

Haal post data op met “get_post” en het “WP_Post” Object

//To get the title for a post with ID 7:
$post_7 = get_post( 7 ); 
$title = $post_7->post_title;

//Alternatively, specify the $output parameter:
$post_7 = get_post( 7, ARRAY_A );
$title = $post_7['post_title'];

//To Get author of the Post
$post_info = get_post( 10 );
$author = $post_info->post_author;

For Reference : WP_Post Object has following properties, which are returned by get_post()

Member Variable Variable Type   Notes
ID          int     The ID of the post
post_author     string  The post author's user ID (numeric string)
post_name   string  The post's slug
post_type   string  See Post Types
post_title  string  The title of the post
post_date   string  Format: 0000-00-00 00:00:00
post_date_gmt   string  Format: 0000-00-00 00:00:00
post_content    string  The full content of the post
post_excerpt    string  User-defined post excerpt
post_status     string  See get_post_status for values
comment_status  string  Returns: { open, closed }
ping_status     string  Returns: { open, closed }
post_password   string  Returns empty string if no password
post_parent     int     Parent Post ID (default 0)
post_modified   string  Format: 0000-00-00 00:00:00
post_modified_gmt   string  Format: 0000-00-00 00:00:00
comment_count   string  Number of comments on post (numeric string)
menu_order  string  Order value as set through page-attribute when enabled (numeric string. Defaults to 0)

Bronnen: