How to create a modal in WordPress? [Own custom plugin]

[ad_1]

Hey guys I am learning how to build plugins in WP. I am super new to it but I have a lot of trouble with the CSS in the admin dashboard. Since I want to be able to have a modal when clicked on a record and it darkens the background of the modal it works but it does something weird with the navbar where 1 part gets super dark.

How could I approach this issue?

Is there any **documentation** for making modals in the dashboard?

https://preview.redd.it/3gh69eww58yc1.png?width=2940&format=png&auto=webp&s=c0e954dda5ce88479611a69737611da97aee3c4a

[ad_2]
3 Comments
  1. Put a div id=“modal” in the footer and hide it with css.

    #modal { display:none }

    Then create a button to open the modal.

    Then use JavaScript to toggle the display class of the modal when the button is clicked.

    Something like…

    $(button).click(function() {
    $(modal).toggle();
    });

    Or google “modal window html example” for code samples.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer