Jump to content

Wordpress_Men/Sub_Menu Functions


kwmlr439

Recommended Posts

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 menu
function 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

I did solve this thank you:

 

//marketing materials for buyers wordpress menu
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" );
 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 menu

function add_marketing_materials(){

    ?>
    <div class="wrap">
        <div class="icon32" id="icon-index"><br></div>
    </div>
    <?php

}

//first time buyers wordpress sub menu

function add_first_time_buyers(){

    ?>
    <div class="wrap">
        <div class="icon32" id="icon-index"><br></div>
    </div>
    <?php

}

//lead generation wordpress sub menu

function add_lead_generation(){

    ?>
    <div class="wrap">
        <div class="icon32" id="icon-index"><br></div>
    </div>
    <?php

}

//ad campaign wordpress sub menu

function add_ad_campaign(){

    ?>
    <div class="wrap">
        <div class="icon32" id="icon-index"><br></div>
    </div>
    <?php

}
 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.