Home > other >  Customize the WordPress Top Menu bar through code
Customize the WordPress Top Menu bar through code

Time:02-10

I'm developing a custom plugin to manage simple application, it consist of simple inquiry, register user, login user and inquiry listing (after successful login).

I achieved this through a shortcode by creating a new post wp_insert_post through code

wp_insert_post([
    'post_title'    => 'Inquiry',
    'post_content'  => '[app_inquiry]',
    'post_status'   => 'publish',
    'post_author'   => 1,
    'post_type'     => 'page',
    'post_name'     => 'inquiry'
]);

I would like to remove the existing top menu bar and need to create a new menu bar with menu item 'Home', 'Register' and 'Login'

If the user is logged-in then the menu should be 'Home' and 'Logout'.

I tried to do but I can't able to achieve.

CodePudding user response:

  •  Tags:  
  • Related