kwmlr439 Posted October 8, 2013 Share Posted October 8, 2013 I have worked so hard to create a WordPress function and I got stuck. I am pretty sure that for some of you it will take 2 second to figure it out. I am familiar with WordPress and I know my way around it but i lack coding skills. Please help me correct this function keeping in mind that I want my banner and logo included and that's what the: <div class="wrap"> and <div class="icon32" id="icon-index"><br></div> is all about. What I am trying to do is the followings: Have a Main menu item in WordPress Dashboard for both Admins and Subscribers to be displayed with the main Menu titled: "For Buyers" then add submenus with the following titles: Marketing Materials - First Time Buyers - Lead Generation - Ad campaigns. Thank you so much, this is a wonderful community . add_action( 'admin_menu', 'register_my_custom_menu_page' );function register_my_custom_menu_page(){add_menu_page( "For Buyers", "For Buyers", "manage_options", "for_buyers", "add_buyers_function", '', 61 );add_submenu_page( "for_buyers", " Marketing Materials", " Marketing Materials", "manage_options", "marketing_materials","add_marketing_materials");} function add_buyers_function(){?><div class="wrap"><div class="icon32" id="icon-index"><br></div></div><?php }//marketing materials for buyers wordpress menufunction add_marketing_materials(){?><div class="wrap"><div class="icon32" id="icon-index"><br></div></div><?php} Link to comment https://forums.phpfreaks.com/topic/282809-wordpress_mensub_menu-functions/ Share on other sites More sharing options...
kwmlr439 Posted October 8, 2013 Author Share Posted October 8, 2013 I did solve this thank you: //marketing materials for buyers wordpress menuadd_action( 'admin_menu', 'register_my_custom_menu_page' );function register_my_custom_menu_page(){ add_menu_page( "For Buyers", "For Buyers", "manage_options", "for_buyers", "add_buyers_function" ); add_submenu_page( "for_buyers", "", "", "manage_options", "for_buyers","add_buyers_function"); add_submenu_page( "for_buyers", "Marketing Materials", "Marketing Materials", "manage_options", "marketing_materials","add_marketing_materials"); add_submenu_page( "for_buyers", "First Time Buyers", "First Time Buyers", "manage_options", "first_time_buyers","add_first_time_buyers"); add_submenu_page( "for_buyers", "Lead Generation", "Lead Generation", "manage_options", "lead_generation","add_lead_generation"); add_submenu_page( "for_buyers", "Ad Campaign", "Ad Campaign", "manage_options", "ad_campaign","add_ad_campaign");}function add_buyers_function(){ ?> <div class="wrap"> <div class="icon32" id="icon-index"><br></div> </div> <?php}//buyers wordpress menufunction add_marketing_materials(){ ?> <div class="wrap"> <div class="icon32" id="icon-index"><br></div> </div> <?php}//first time buyers wordpress sub menufunction add_first_time_buyers(){ ?> <div class="wrap"> <div class="icon32" id="icon-index"><br></div> </div> <?php}//lead generation wordpress sub menufunction add_lead_generation(){ ?> <div class="wrap"> <div class="icon32" id="icon-index"><br></div> </div> <?php}//ad campaign wordpress sub menufunction add_ad_campaign(){ ?> <div class="wrap"> <div class="icon32" id="icon-index"><br></div> </div> <?php} Link to comment https://forums.phpfreaks.com/topic/282809-wordpress_mensub_menu-functions/#findComment-1453129 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.