jrp91384 Posted October 29, 2009 Share Posted October 29, 2009 Hello, Situation: I’m trying to link to another page from within a page. I have my pages within one file. How do you link to another page or function? Each page’s content is within its own function. I want to link the first list item (Definitions) to the page definitions page. Sorry if I have not explained my question very well. I’m a complete beginner of php and it’s a bit over my head. Just trying to create a small plugin for WP. Any help is greatly appreciated! Thanks add_submenu_page( __FILE__, 'xxx Center Overview', 'Overview', 5, __FILE__, 'vis_page_overview'); add_submenu_page( __FILE__, 'Admin Menu Definitions', 'Definitions', 5, 'definitions', 'vis_definitions'); //================================ // Overview Page Content //================================ function vis_page_overview() { echo ' <div class="wrap"> <p id="icon-edit" class="icon32"><h2>xxx Center Overview</h2></p> <p>Below you will find instructions on how to perform common tasks that are specific to your site.</p> <div class="vis-box1"> <div class="box-heading">Quick Links</div> <ul> <li><a href="#">Definitions</a></li> <li><a href="#">Pages</a></li> <li><a href="#">Sidebar</a></li> <li><a href="#">Footer</a></li> <li><a href="#">Copyright</a></li> <li><a href="#">xhtml Tags</a></li> </ul> </div> <div class="vis-box2"> <div class="box-heading">Accounts</div> </div> <div class="vis-box3"> <div class="box-heading">Tutorials</div> </div> <div class="vis-box4"> <div class="box-heading">Help</div> </div> </div> '; } //================================ // Definitions Page Content //================================ function vis_definitions() { echo ' <div class="wrap speclists"> <a name="top" id="top"></a> <p id="icon-edit-comments" class="icon32"><h2>Admin Menu Definitions:</h2><p> <p> etc....etc.... Link to comment https://forums.phpfreaks.com/topic/179519-solved-link-help-please/ Share on other sites More sharing options...
lemmin Posted October 29, 2009 Share Posted October 29, 2009 Look through the code for a call to vis_definitions() that has a conditional check before it for some post or get value. something like: if ($_GET['page'] == "definitions") vis_definitions(); Whatever that check is, that is how you want to link to the page. If it is how I stated, then your link code would be like this: <li><a href="?page=definitions">Definitions</a></li> If you can't figure it out from that, post the code where you find the call to vi_definitions and someone can help you more. Link to comment https://forums.phpfreaks.com/topic/179519-solved-link-help-please/#findComment-947268 Share on other sites More sharing options...
jrp91384 Posted October 29, 2009 Author Share Posted October 29, 2009 Thank you so much lemmin!!! That did the trick. Link to comment https://forums.phpfreaks.com/topic/179519-solved-link-help-please/#findComment-947277 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.