Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6353263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:22:52+00:00 2026-05-24T22:22:52+00:00

I am attempting to use the jQuery UI dialog script in my WordPress theme

  • 0

I am attempting to use the jQuery UI dialog script in my WordPress theme admin page. Everything is straight from the UI demo and yet I end up with a dialog box where the dialog is not popped up over anything and instead buried in bottom corner, just before the closing body tag.

The UI dialog script is queued properly w/ wp_enqueue_script as its shows up in the source code as does jquery (from google API) and the UI core.

jQuery(document).ready(function($) {
    $("#dialog").dialog();
}); //end onload stuff

Then I have this in my options page:

<div id="dialog" title="Basic dialog">
<p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T22:22:53+00:00Added an answer on May 24, 2026 at 10:22 pm

    You should be all ready to go. WP already has dialog and styles for it.

    Here are the steps to use it:

    1. Write the jQuery for creating the dialog box – you must use the dialogClass of wp-dialog
    2. Enqueue the above file on init using the proper dependencies (jquery-ui-dialog)
    3. Enqueue the proper WP styles (wp-jquery-ui-dialog)

    For example:

    // custom.js
    jQuery(function($) {
        var $info = $("#modal-content");
        $info.dialog({                   
            'dialogClass'   : 'wp-dialog',           
            'modal'         : true,
            'autoOpen'      : false, 
            'closeOnEscape' : true,      
            'buttons'       : {
                "Close": function() {
                    $(this).dialog('close');
                }
            }
        });
        $("#open-modal").click(function(event) {
            event.preventDefault();
            $info.dialog('open');
        });
    });    
    

    In your PHP

    add_action( 'admin_enqueue_scripts', 'queue_my_admin_scripts');
    
    function queue_my_admin_scripts() {
        wp_enqueue_script (  'my-spiffy-miodal' ,       // handle
                            URL_TO_THE_JS_FILE  ,       // source
                            array('jquery-ui-dialog')); // dependencies
        // A style available in WP               
        wp_enqueue_style (  'wp-jquery-ui-dialog');
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When attempting to use HttpWebRequest to retrieve a page from my dev server, I
I'm attempting to select all <script type=text/html> tags in a page. I use <script>
I am attempting to use a JQuery dialog to popup a window upon let's
I'm attempting to use JQuery to create a dynamic page header using an image
I am attempting to use a Jquery menu, that makes use of the 'easeOutBounce'
I'm attempting to use the jQuery jFeed plugin for parsing an Atom, GeoRSS feed
I am attempting to use livequery. I unfortunately am stuck using jquery 1.2.6. This
Attempting to use the data series from this example no longer passes the JSONLint
In attempting to use std::select1st from <functional> in a VS2008 project I found that
I'm attempting to use jQuery to do a $.post() to an MVC controller action.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.