I want to add my admin panel "a menu" and inside it a iframe page
-
Hi I want my admin panel a menu and when I click on it , I want it to open a iframe page .. How can I do that.. Thanks
-
Hi halukaydogan,
As per my understanding your requirement is to add a custom link in admin section which when click would render a admin page with IFrame.
Considering this, I would suggest you to attach a custom function to ‘admin_menu’ hook. And register a new admin page using ‘add_menu_page’ method.
please add following code in "functions.php" file of your active template. add_action( 'admin_menu', 'register_external_link_menu_page' ); function register_external_link_menu_page(){ add_menu_page( 'External Link', 'External Link', 'manage_options', 'external_link', 'external_link_menu_page', '', 80 ); } function external_link_menu_page(){ echo "<h2>External Link Page</h2>"; echo '<iframe src="https://codex.www.ads-software.com" width="100%" height="550"></iframe>'; }
Hope this solution is what you are looking for.
Thanks
Thanks very much=) one more question: if I want 2 or more external link?
If in case you require more external links then I would suggest you use add_subpage_menu() method.
I have modified the code for your reference, please check the code snippet-
add_action( 'admin_menu', 'register_external_link_menu_page' ); function register_external_link_menu_page(){ add_menu_page( 'External Link', 'External Link', 'manage_options', 'external_link', 'external_link_menu_page', '', 80 ); add_submenu_page( 'external_link', 'External Link 2', 'External Link 2', 'manage_options', 'external_link_menu_page', 'external_link_submenu_page2'); } function external_link_menu_page(){ echo "<h2>External Link Page</h2>"; echo '<iframe src="https://codex.www.ads-software.com" width="100%" height="550"></iframe>'; } function external_link_submenu_page2(){ echo "<h2>External Link2 Page</h2>"; echo '<iframe src="https://codex.www.ads-software.com" width="100%" height="550"></iframe>'; }
Thanks.
Yeah that is and everything perfect just except when I click the link in admin menu it tells ” the server refuse to connection” ..
also thanks very much for your time this was a big problem for me…
}
add_action( ‘admin_menu’, ‘register_external_link_menu_page’ );function register_external_link_menu_page(){
add_menu_page( ‘External Link’, ‘External Link’, ‘manage_options’, ‘external_link’, ‘external_link_menu_page’, ”, 80 );
add_submenu_page( ‘external_link’, ‘External Link 2’, ‘External Link 2’, ‘manage_options’, ‘external_link_menu_page’, ‘external_link_submenu_page2’);
}function external_link_menu_page(){
echo “<h2>External Link Page</h2>”;
echo ‘<iframe src=”https://dashboard.tawk.to” scrolling=”no” frameborder=”0″ align=”center” height = “800px” width = “100%” name=”Tawk.To”, border=”0″>
</iframe>’;
}function external_link_submenu_page2(){
echo “<h2>External Link2 Page</h2>”;
echo ‘<iframe src=”https://mail.godiamond.org/Mondo/lang/sys/Login.aspx” scrolling=”no” frameborder=”0″ align=”center” height = “800px” width = “100%” name=”Tawk.To”, border=”0″>
</iframe>’;
}with this code it is done thank?s very very very much again.. I hope you go to heaven for that,=)
it is not a overreact =) just spending my time for 2 days and in 1 hour it is done.. I feel very happy=)
add_action( ‘admin_menu’, ‘register_external_link_menu_page’ );
function register_external_link_menu_page(){
add_menu_page( ‘External Link’, ‘External Link’, ‘manage_options’, ‘external_link’, ‘external_link_menu_page’, ”, 80 );
add_submenu_page( ‘external_link’, ‘External Link 2’, ‘External Link 2’, ‘manage_options’, ‘external_link_menu_page’, ‘external_link_submenu_page2’);
add_submenu_page( ‘external_link’, ‘External Link 2’, ‘External Link 2’, ‘manage_options’, ‘external_link_menu_page’, ‘external_link_submenu_page3’);
}function external_link_menu_page(){
echo ‘<iframe src=”https://dashboard.tawk.to” scrolling=”no” frameborder=”0″ align=”center” height = “800px” width = “100%” name=”Tawk.To”, border=”0″>
</iframe>’;
}function external_link_submenu_page2(){
echo ‘<iframe src=”https://mail.godiamond.org/Mondo/lang/sys/Login.aspx” scrolling=”no” frameborder=”0″ align=”center” height = “800px” width = “100%” name=”Tawk.To”, border=”0″>
</iframe>’;
}function external_link_submenu_page3(){
echo ‘<iframe src=”https://neden.godiamond.org” scrolling=”no” frameborder=”0″ align=”center” height = “800px” width = “100%” name=”Tawk.To”, border=”0″>
</iframe>’;
}in that code , subdomains links open in same windows.. there is 2 link but 2 of them in same area.. where is the wrong?
- The topic ‘I want to add my admin panel "a menu" and inside it a iframe page’ is closed to new replies.