Jquery is not working in wordpress php file

wp_enqueue_script( ‘my-jquery’, get_stylesheet_directory_uri() .’/js/jquery-1.9.0.js’, array( ‘jquery’ ) ); check for jquery error also check with source code if file is being loaded or not. you must have included jquery library before including your js file.

Hide input field when second input field is in focus

This question is out of scope here. You should try stackoverflow for this question. Though I would like to answer your question. You need to use some CSS as well as JQuery for getting the desired result. See the working fiddle here. Hope this works for you. CSS addition: input[type=subscribe]:focus + input[type=search] { display:none; } … Read more

slide change on hover with nextgen scrollgallery [closed]

Solution I am providing intiates the click event when mouse enters the thumbnail (with a delay to avoid passing mouse events). jQuery(‘.scrollgallery .thumbarea img’).hover(function(e){ this.ScrollGalleryHover = setTimeout(‘initiateClick(“‘+jQuery(this).attr(‘src’)+'”);’,500); },function(e) { clearTimeout(this.ScrollGalleryHover); }); function initiateClick(src) { jQuery(‘.scrollgallery .thumbarea img[src=”‘+src+'”]’).click(); }

Get post id on click of thumbnail

You need ajax. The html: <div id=”PersonBio”></div> <div id=”mainTextTitle”></div> <div id=”mainText”> <ul class=”faces”> <?php $categories = get_categories(); foreach ( $categories as $category ) { $i = -1; echo ‘<div class=”grid-row”><h2>’ . $category->name . ‘</h2></div>’; $args = array( ‘posts_per_page’ => -1, ‘cat’ => $category->term_id ); $cat_posts = new WP_Query($args); if ( $cat_posts->have_posts() ) : while ( … Read more