Tag Info

New answers tagged

-1

Tty this one jQuery.getJSON('/latest-post-as-json/', function(data) { jQuery('#externalBlock').append('<h1>'+data.post_title+'</h1>'); jQuery('#externalBlock').append(data.post_content); //etc });


1

Quite a few options you have here but the simplest I suppose would be to change your SQL query like so: SELECT 0 AS id, user_login AS name, display_name AS tag, user_status AS status FROM wp_users; You can see that now we have the needed order and when you will do the $row['id'] = $i; assignment we will use that position instead of creating a ...


0

As per documentation on wp_remote_get() it doesn't return you just the body of requested resource. Its return will be either the array of data or WP_Error object on failure. The simplest snippet to get to the body would be: $json = wp_remote_retrieve_body( wp_remote_get( $url ) ); PS it's kinda weird to be doing this in shortocde, are you sure it's most ...


0

I think you can do this by following way - Install the plugin https://wordpress.org/plugins/json-rest-api/ on the site from where you want to pull the posts. It makes the WordPress data available in json format. It is also possible to filter the request to get specific data. You can read the documentation in detail here at http://v2.wp-api.org Look for ...


1

You don't need to configure anything. As soon as you connect Jetpack to your WordPress.com account and activate the JSON API module, you'll be able to to use the API. You can double check that by running some test queries using the REST API Console here. You could also just try to load one of the endpoints in your browser, like so. If you're still having ...


0

API Endpoints plugin should cover all your needs, especially if you are familiar with MySQL. You would do the following steps: Create a new Twig Template, enter your MysQL query to fetch data from your WordPress site and use Twig syntax to output the data in any format. For example, JSON. Create a new API endpoint, give it a name and configure it to use ...


0

Solved the problem thanks to the guidance of @shanebp: The issue was how the data was being called through PHP and ajax. Instead of using the name attribute in the input field, I used var_dump to see what $_POST was outputting and found that the array created (formdata) in jQuery was what $_POST was retrieving. Instead of using the name attribute, I had to ...


0

What makes you think this will ever be true? if (isset($_POST['submit'])){ In function dav_form_validation the die() is in 2 conditionals. It should be called regardless of whether the conditionals are satisfied. Add 2 else clauses and return error messages. Usually a response of '0', means the ajax hooks are not being found. But your code seems okay ...



Top 50 recent answers are included