0

Hello i'm first tackling on wordpress, any help would be much appreciated . i want to in admin's panel menu add custom page where admin can add ID's of posts and those posts should be display on front page automatically. i already created this page and added some inputs. but, how to done next steps? where to send post request or how to get it ?

add_action( 'admin_menu',  'create_settings_page' );

 function create_settings_page() {
    // Add the menu item and page
    $page_title = 'Display Recent Wins';
    $menu_title = 'select listings';
    $capability = 'manage_options';
    $slug = 'smashing_fields';
    $callback = 'settings_page_content' ;
    $icon = 'dashicons-admin-plugins';
    $position = 100;

    add_menu_page( $page_title, $menu_title, $capability, $slug, $callback, $icon, $position );
}

 function settings_page_content() {
    ?>
    <h2>Select Listing ID</h2>
    <form action="" method="post">
        <input type="text" name=id[]></input>
        <input type="text" name=id[]></input>
        <input type="text" name=id[]></input>
        <input type="submit" name="create" />
    </form>
    <?php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.