How to apply wordpress css styles to a jQueryUi dialog?

You can do it in two ways: Apply the same IDs, classes and general DOM element identification that you have on your website, to the content being shown in the modal dialog. This way, they’ll read from the same css directives you already have in place. OR If the styles you want to copy are … Read more

Adding a slider captcha to the comment system

First things first, there is quite a bit of _doing_it_wrong() in the script enqueueing. Don’t override core-bundled scripts Try removing this hook callback, and see if that fixes things: function my_scripts_method() { wp_deregister_script( ‘jquery’ ); wp_deregister_script( ‘jquery ui’ ); wp_register_script( ‘jquery’, ‘http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js’); wp_register_script( ‘jquery ui’, ‘https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js’); wp_enqueue_script( ‘jquery’ ); wp_enqueue_script( ‘jquery ui’ ); } add_action(‘wp_enqueue_scripts’, … Read more

Override theme style with other CSS on a specific page

You want the plugins style sheet to over ride your themes style sheet conditionally ( on one page). Dequeue your themes style sheet for a specific page conditionally. add_action( ‘wp_enqueue_scripts’, ‘remove_default_stylesheet’, 25 ); function remove_default_stylesheet() { if ( is_page( page id or slug) ) { wp_dequeue_style( ‘original-enqueue-stylesheet-handle’ ); wp_deregister_style( ‘original-register-stylesheet-handle’ ); wp_register_style( ‘new-style’, plugins_url(‘stylesheet.css’, __FILE__) … Read more

jQuery.accordion isn’t a function even when enqueued

The 3rd parameter in the call to wp_register_script() should be an array of dependencies – not a string. Change this: wp_register_script(‘fl-custom-js’, get_template_directory_uri() . ‘/faq/faq.js’, ‘jquery-ui-accordion’, ”, true); To: wp_register_script(‘fl-custom-js’, get_template_directory_uri() . ‘/faq/faq.js’, array(‘jquery-ui-accordion’), ”, true);

Format numeric symbols in titles

WordPress makes number of typographical replacements, related to dashes. You can read through the How WordPress Handles Dashes and Hyphens for full details, but in short your specific case is [space][hyphen][space] getting replaced with [space][en-dash][space]. You will have to step through your code to make sense at which point it goes wrong and turns into … Read more

Loading jQuery UI in the head

Actually. This answer is the only correct answer. If you need jQuery for a certain script just add it as necessary in the jQuery array. wp_register_script( ‘ytc-admin-scripts’, YTC_URL . ‘admin/admin-functions.js’, array( ‘jquery’,’jquery-ui-slider’ ), ‘1.0’);

jQuery UI inside widget on admin page

Ok, so, for some reason I can’t comprehend, the answer is that the div element containing the tabs should have a class and not an id for jQuery UI to work properly, as such: <div class=”mytabs”> and jQuery(document).ready(function($) { $(“.mytabs”).tabs(); }); Just for the record, the way I enqued the scripts is: add_action( ‘admin_enqueue_scripts’, ‘load_my_admin_js’ … Read more

jquery-ui-autocomplete is not loaded with wp_enqueue_script

Are you sure it is not loading? I tried this(using WordPress 3.6-beta1): function add_scripts(){ wp_enqueue_script( ‘jquery-ui-autocomplete’ ); } add_action(‘wp_enqueue_scripts’, ‘add_scripts’); I got jQuery and jQuery migrate in the header: <script type=”text/javascript” src=”http://localhost/wordpress/wp-includes/js/jquery/jquery.js?ver=1.9.1″></script> <script type=”text/javascript” src=”http://localhost/wordpress/wp-includes/js/jquery/jquery-migrate.js?ver=1.1.1″></script> And jQuery UI in the footer: <script type=”text/javascript” src=”http://localhost/wordpress/wp-includes/js/jquery/ui/jquery.ui.core.min.js?ver=1.10.2″></script> <script type=”text/javascript” src=”http://localhost/wordpress/wp-includes/js/jquery/ui/jquery.ui.widget.min.js?ver=1.10.2″></script> <script type=”text/javascript” src=”http://localhost/wordpress/wp-includes/js/jquery/ui/jquery.ui.position.min.js?ver=1.10.2″></script> <script type=”text/javascript” src=”http://localhost/wordpress/wp-includes/js/jquery/ui/jquery.ui.menu.min.js?ver=1.10.2″></script> <script type=”text/javascript” … Read more

Utilizing WordPress’ Admin UI for plugin settings: getting accordion style

Here’s how I do it for my plugin/options page (which is inside a class, thus the $this-> construct): /* enqueue our css */ public function enqueue_options_style( $hook ) { if( $hook == $this->admin_page ) wp_enqueue_style( ‘my-options’, ‘/some-directory/my-options.css’, false, $this->version ); // only present for our plugin’s settings page } $this->admin_page is the slug returned from … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)