wordpress get content main menu

Posted by eca_arpit on Pro Webmasters See other posts from Pro Webmasters or by eca_arpit
Published on 2012-06-01T06:57:39Z Indexed on 2012/06/01 10:51 UTC
Read the original article Hit count: 182

Filed under:

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);

}

© Pro Webmasters or respective owner

Related posts about Wordpress