AJAX – Returning Two JSON Objects with One PHP Function

If I get it correctly, You need to wrap them in an array and pass to Javascript. function get_ldap_attr() { header(“Content-type: application/json”); … // suppose you want to return $second_var echo json_encode(array($sup,$second_var)); die(); } Success function of JSON request will receive them as array. You can access them with integer index. jQuery(function() { jQuery(‘#empLanId’).on(‘blur’, function() … Read more

How can i display a jquery slide on front page

As Jerome mentioned in his comment, including your own version of jQuery via a script tag is wrong. Nextgen adds the WordPress supplied version correctly via wp_enqueue_script, which creates the conflict. Remove the inclusion of jQuery via script tag. Properly enqueue your other javascript files with jQuery as a dependency. Fix your jQuery code to … Read more

Admin ToolBar not being displayed at top of site

It sounds like your theme does not use wp_footer() the way it should. That function should occur right before the closing </body> tag. The admin bar runs on a hook fired by that function. Without it, I get exactly what you describe. For reference, in Twenty Thirteen, it looks like this: http://core.trac.wordpress.org/browser/trunk/wp-content/themes/twentythirteen/footer.php

Catchable fatal error on 3.6 update

image_resize (deprecated) is returning an error object so really, the problem is here: $new_img_path = image_resize( $file_path, $width, $height, $crop ); Something is wrong with that line and you are not checking whether the return value is an error object or a string before trying to use the return value as a string. You did … Read more

Creating sub-categories via php

You can use the wp_insert_term() function to achive this. First create the parent category, then create a child category. $parent = wp_insert_term( ‘Parent Category’, // category name ‘category’, // taxonomy array( ‘description’ => ‘Category description’, // optional ‘slug’ => ‘parent-category’, // optional ) ); wp_insert_term( ‘Child Category’, // category name ‘category’, // taxonomy array( ‘description’ … Read more

Create menu locations for each category in wordpress

You’re going about this wrongly, I think. The theme_location parameter for wp_nav_menu() is a template location – i.e. a physical location in the template, as defined/registered by the Theme. It’s not designed for an arbitrary number of locations based on arbitrary user content. If you want to output category-specific menus in specific template locations, you … Read more

add_action into another add_action not working

The preferred method of creating a settings page is to use the WordPress Settings API. From your code example, it looks like it’s too late to remove the admin_notices hook inside your callback in the admin_menu hook. You should try to move the logic from the customfunc() callback into another callback activated from some earlier … Read more