How to override wp-admin styling

As noted by @Fusion, this has changed beginning with version 5. In order to override admin styles for 5.*, you need a hook in functions.php, something like this: function custom_admin() { $url = get_settings(‘siteurl’); $url = $url . ‘/wp-content/themes/my-theme/wp-admin.css’; echo ‘<link rel=”stylesheet” type=”text/css” href=”‘ . $url . ‘” />’; } add_action(‘admin_head’, ‘custom_admin’) Sources: WordPress Codex … Read more

Automatic jQuery accordion from header tags

You can use shortcode function to do this. function accordion_shortcode( $atts, $content = null ) { extract( shortcode_atts( array( ‘class’ => ‘accordion’, ), $atts ) ); return ‘<div class=”‘ . esc_attr($class) . ‘”>’ . $content . ‘</div>’; } add_shortcode( ‘accordion’, ‘accordion_shortcode’ ); In editor you wrap your content: [accordion] <h3>Headline 1</h3> <p>Content.. lorem ipsum</p> <h3>Headline … Read more

How to enable the content editor as a droppable target with jQuery-ui?

In the above example the following line: jQuery(“.myDiv”).find(“li”).each(function(){ should be: jQuery(“.keywords”).find(“li”).each(function(){ That should enable the list items to be dragged and dropped. To allow the items to be dropped on the TinyMCE textarea the following code works. $(‘#editorcontainer’).droppable({ drop: function(event, ui) { alert(‘dropped’); //NOW FIRES! //Dynamically add content tinyMCE.activeEditor.execCommand(‘mceInsertContent’, false, ‘New content.’); } });

Override default jquery ui library with newer version

Add the following code in functions.php file of your theme that will remove default jquery ui core and will add your provided latest jquery ui core file from your theme. function my_scripts_method() { if(!is_admin()){ wp_deregister_script( ‘jquery-ui-core’ ); wp_enqueue_script(‘jquery-ui-core’, get_stylesheet_directory_uri().’/jquery.ui.core.min.js’, array(‘jquery’), ‘1.9.2’, 1 ); } } add_action(‘wp_enqueue_scripts’, ‘my_scripts_method’); Tell me if it works for you or … Read more

Which jQueryUI handles are predefined in wordpress?

Just take a look at the Codex for all the default scripts and their slugs. The jQuery UI stuff is: Name Handle Dependencies jQuery UI Core jquery-ui-core jquery jQuery UI Widget jquery-ui-widget jquery jQuery UI Mouse jquery-ui-mouse jquery jQuery UI Accordion jquery-ui-accordion jquery jQuery UI Autocomplete jquery-ui-autocomplete jquery jQuery UI Slider jquery-ui-slider jquery jQuery UI … Read more

Admin area ‘toggle’ w/ cookie

Checkout the HTML for a WP meta-box : <div id=”my_div” class=”postbox “> <div class=”handlediv” title=”Click to toggle.”><br></div> <h3 class=”hndle”><span>title</span></h3> <div class=”inside”> … </div> </div> If you follow that structure (and CSS classes) in your custom meta-box, the toggle will work.

Ajax with jQuery UI dialog not working

Assuming your javascript and ajax action code are otherwise correct, target admin-ajax.php with the correct path by localizing your enqueued script: wp_localize_script( ‘your_script_handle’, ‘script_data’, array( ‘admin_ajax’ => admin_url( ‘admin-ajax.php’ ) ) ); Then in your javascript, reference that URL with: url: script_data.admin_ajax EDIT- ah, missed this the first time: $wpdb->feedmanager isn’t set unless you’ve explicitly … Read more

Timepicker-addon doesn’t show – Datepicker works fine?

Figured out that I needed to have the right js dependencies declared. This code now works. Hope it helps someone else with the same problem. Key line array(‘jquery-ui-core’ ,’jquery-ui-datepicker’, ‘jquery-ui-slider’) Full `wp-enqueue’ code: function pbd_events_jquery_datepicker() { wp_enqueue_script( ‘jquery-ui-datepicker’, get_bloginfo(‘template_directory’) . ‘/jquery-ui-datepicker/jquery-ui-1.8.16.custom.min.js’, array(‘jquery’) ); wp_enqueue_script( ‘jquery-ui-timepicker-addon’, get_bloginfo(‘template_directory’) . ‘/jquery-ui-datepicker/jquery-ui-timepicker-addon.js’, array(‘jquery-ui-core’ ,’jquery-ui-datepicker’, ‘jquery-ui-slider’) ); wp_enqueue_script( ‘pbd-datepicker’, get_bloginfo(‘template_directory’) … Read more

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