WordPress Comments jQuery Doesn’t submit

Original Poster’s answer in comments also worked for me, will share it here so this can have a solution. Replace: $(‘form’).submit(); With: $(‘form’).unbind(‘submit’); $(‘#submit’).click(); I used this to submit comments with JQuery with the ENTER key rather than clicking the button: jQuery(document).ready(function($) { $(‘#comment’).keydown(function(event) { if (event.keyCode == 13) {//capture ENTER Key $(‘form’).unbind(‘submit’); $(‘#submit’).click(); return … Read more

What is the best way to get the first few post from WordPress in different divs using a loop?

Use this code for the loop. I removed your comments and added some for clarification. <?php if ( have_posts() ) { // Do first post. add_filter( ‘the_content’, ‘narga_excerpts’ ); add_filter( ‘the_content’, ‘remove_first_image’ ); the_post(); get_template_part( ‘content’, get_post_format() ); // Do remaining posts. remove_filter( ‘the_content’, ‘narga_excerpts’ ); remove_filter( ‘the_content’, ‘remove_first_image’ ); while ( have_posts() ) { … Read more

Jquery script not loading on site Front page

WordPress uses jQuery noConflict wrappers so the dollar sign will not work unless it is used as an alias. Either wrap your code in: jQuery(document).ready(function($) { // Inside of this function, $() will work as an alias for jQuery() // and other libraries also using $ will not be accessible under this shortcut }); Or … Read more

Clear custom field when new tag is added

Could you do something like this? function tag-added-script() { ?> <script> jQuery(function($) { $(‘.tagadd’).click(function() { // Run Your Jquery Here alert(‘test’); }); }); </script> <?php } add_action( ‘admin_head’, ‘tag-added-script’ ); The above will react whenever the “tagadd” button is clicked. Theoretically you could then grab the custom field ID and clear it via jquery.

Group posts by weekly or monthly

Sorry, but what’s the use scope of JSON API plugin here? The only thing you need is ad the week (or wahtever information you need) in the markup of the page. Assuming your loop is somethin like this: <ul id=”postlist”> <?php while( have_posts() ) : the_post(); ?> <li id=”post_<?php the_ID(); ?>” class=”post”> <h2><?php the_title(); ?></h2> … Read more

How to update scrollbar when using Jetpack’s Inifnite Scroller?

Ok, I found the solution at Jetpack’s website, http://jetpack.me/support/infinite-scroll/ I just needed to insert the custom scrollbar’s update function inside this function provided by jetpack’s infinite scroll. “JavaScript Events Inevitably, there are situations in a theme that require some JavaScript interaction after posts are added. One such example is in a theme that uses jQuery … Read more