WordPress Ajax Always returning 0

Try die() function in the end of PHP function. It will helps. UPD: Ive made some simple version of your problem code to check it and it works. I think it will helps you. You are able to change inner PHP script to your logic and it wont returns 0. PHP: function more_post_ajax(){ echo “Hello”; … Read more

How to retrieve the data from the sever and displaying it in a page?

So in this case, the problem is that your line right before the echo call is incomplete: $number_rows= $wpdb->get_var( “SELECT COUNT(*) FROM $wpdb->daviddgl_wp1.SaveContactForm7_7” ); $x=1; while ($x<$number_rows) { $results = $wpdb->get_results(“SELECT ticket, name,email FROM $wpdb->daviddgl_wp1.SaveContactForm7_7 WHERE id = $x”); print_r($results); $x++; } (You’re missing the closing bracket and semi-column) Note also that your echo will … Read more

Display custom field on 404 page outside loop

You should not hide functionality in a template file. Templates are dumb, you don’t run unit tests on them normally. I’d recommend to move the logic to a separate function in your functions.php: function header_class( $default=”white” ) { $post = get_post(); // 404 pages, empty archives (user, taxonomy, date) if ( empty( $post ) ) … Read more

How to Disable WordPress Page Revisions?

By default, Pages and Posts support very similar things. The full list can be found on Trac. If we want to remove one of these post type features we can use the remove_post_type_support() function: function remove_posttype_supports() { remove_post_type_support( ‘page’, ‘revisions’ ); } add_action( ‘init’, ‘remove_posttype_supports’ ); The above you would need to put in your … Read more