wordpress get content main menu
- by eca_arpit
I added a menu page named "Home" on wp-admin. It was added successfully. when i click this home menu then it display nothing.Now i want to display content of a page suppose Page_id=15 on right side(which is empty after clicking home). 15 number page has php codes and uses a template also...is it possible to display contents..i wrote following code...if any confusion i can explain more..plz help me out..
i wrote this in a plugin.
add_action('admin_menu', 'Home');
function Home() {
add_menu_page('My Plugin Options', 'Home', 'manage_options', 'my-unique-identifier', 'content');
}
function content() {
if (!current_user_can('manage_options')) {
wp_die( __('You do not have sufficient permissions to access this page.') );
}
$page_id = 15; $header_content = get_page( $page_id ); echo apply_filters('the_content', $header_content-post_content);
}