The following lines of codes will let you have content from separate pages without ID in WordPress.
1 2 3 4 5 6 7 8 9 10 11 | <?php //PERFORMS MYSQL QUERY TO GET THE POST ID //note: 'about' is the name of the page, you can use any named, ex: 'web services' $about_page_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_name = 'about'"); $post_id = get_post($about_id); $content = $post_id->post_content; //applies wordpress filter (includes <p> tags) $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); echo $content; ?> |