Tag Info

New answers tagged

0

One of the parameters of the enqueue_script function is the $in_footer take a look of the function usage arguments: wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer ) So to add your script(or css) to the header instead of footer you should try something like: wp_enqueue_script('tooltipster', urlto.'/jsjquery.tooltipster.min.js', array( ...


2

It seems that you need to add styles and scripts to a single post. The best way to achieve this is to make use of the conditional tag is_single() With that you target specific single posts or all single posts. Styles should always be loaded in the header. <link> tags outside the <head></head> tags are invalid HTML. You should check this ...


0

I cant figure out where to hook so that A. The $post is set up and 2. the style and script get included in the header. Those two things are mutually exclusive. The global $post won't be set up until the main Loop starts, which is well after the header has already been output. Edit for comments clarification: Again, the actual global $post isn't set ...


0

It must be pretty late in the action order because I've tried hooking to admin_notices from it and it doesn't work. $function callback (param of add_submenu_page) is used to output the content of admin pages, so it runs when WordPress is actually displaying the markup (body) of page. That should be pretty clear because you use echo inside that ...


1

You can simply use current_filter() WordPress function. http://codex.wordpress.org/Function_Reference/current_filter


0

@PieterGoosen & @kaiser https://wordpress.org/plugins/osd-remove-all-wp-creds/ That is the link to the plugin. It removes quite a few WP plugs like: Title Bar in Admin Section Favicon in Admin Section Favicon on Login Page Tagline Admin Menu Bar Various widgets are removed Various Meta boxes Welcome Panel Admin Footer Login Screen Logo Login Screen ...


0

Every post / page / post type is wrapped around a universal form with the ID of #post. So if you want to validate a page before submitting it you just need to say something like: jQuery(document).ready(function($){ $('#post').submit(function(){ // Validate Stuff return false; }); }); Then you'll want to actually enqueue your ...


2

This should be an extension to @birgire answer. One of the site members, @beultge has written a quite extensive plugin called Debug Objects One of the many functions included is printing a list of hooks and filters that is executed on a page load. PS! I don't have any affiliation to the plugin


8

"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay." -The Adventure of the Copper Beeches So let's gather some real data from an install with no plugins and the TwentyTwelve theme activated with only a single Text widget. For the home page the following do_action calls are made in the following order: muplugins_loaded ...


-2

Here is the WordPress load chart


0

Thanks for all the help, unfortunately I don't have enough time to figure out what isn't working (customer tapping feet). All suggestions did'nt work, so I'm going the "normal" (ugly) way of reading out $_POST. Thanks for the efford.


0

Change your wp_localize_script-Call to the right Action: wp_localize_script( 'addItemToNav', 'menuItems', array( // URL to wp-admin/admin-ajax.php to process the request 'ajaxurl' => admin_url( 'admin-ajax.php' ), // generate a nonce with a unique ID "myajax-post-comment-nonce" 'postCommentNonce' => wp_create_nonce( ...


0

Your AJAX Requests requires an JSON to be returned. But I think your function doesn't return valid JSON. Haven't tested it, but this function should work: function update_nav_items() { // Testing stuff $response = json_encode( array( 'response' => 'success', 'html' => 'some value' ) ); // first JSON encode ob_clean(); ...



Top 50 recent answers are included