Ajax contact form return 0

Your javascript is missing an action parameter with the data: $.post(action, { name: $(‘#name’).val(), email: $(‘#email’).val(), phone: $(‘#phone’).val(), subject: $(‘#subject’).val(), comments: $(‘#comments’).val(), verify: $(‘#verify’).val(), action: ‘ajaxContacForm’ // <– added action here }, function(data){ document.getElementById(‘message’).innerHTML = data; $(‘#message’).slideDown(‘slow’); $(‘#contactform img.loader’).fadeOut(‘slow’,function(){$(this).remove()}); $(‘#submit’).removeAttr(‘disabled’); if(data.match(‘success’) != null) $(‘#contactform’).slideUp(‘slow’); } );

WP_Query fails despite having 1 post

T a look at how to properly construct a query with WP_Query. $args = array( ‘post_type’ => ‘cameras’, ‘posts_per_page’ => 5, ); $the_query = new WP_Query( $args ); // The Loop if ( $the_query->have_posts() ) { echo ‘<ul>’; while ( $the_query->have_posts() ) { $the_query->the_post(); echo ‘<li>’ . get_the_title() . ‘</li>’; } echo ‘</ul>’; } else … Read more

PHP conditional script issue

You have a lot of PHP tag spam, e.g.: ?><?php This is bad, confusing, makes your code difficult to read, and a waste of your time to type. It’s the difficulty reading your code that has lead to your problem, including the lack of indentation. These are important, and any good editor will do them … Read more