Trying to integrate wordpress query on other website – getting redirection to wp-install

Providing this will work if it’s all on the same server. This is the PHP I use at the top of non-wordpress site. define(‘WP_USE_THEMES’, false); require(‘/home/sites/example.co.uk/www/wp/wp-load.php’); Obviously you just need to put your server path to the wp-load.php file. Just write your news query and loop it should feed in the content to your non-wordpress … Read more

Cannot get transient to work on shortcode, Moz API

You need to return $seo_grade outside the if i.e. at the very end of your function – at the moment you’re saying “if no transient, create one and return it, otherwise return nothing”. Also at the top, you return $seo_grade if the domain is “NULL”, but the variable will be undefined (possible typo – you’re … Read more

basic wordpress api endpoint to serve a key-value dictionary

You could create your own WP REST API endpoint that handles this. To register a custom endpoint: add_action( ‘init’, ‘bootstrap_api’ ); function bootstrap_api() { add_action( ‘rest_api_init’, ‘my_api_endpoint’ ); } function my_api_endpoint() { register_rest_route(‘myapi/v1’, ‘get/words’, array( ‘methods’ => ‘GET’, ‘callback’ => ‘return_word_list’, ) ); } function return_word_list() { // Do someting to build your list of … Read more

Querying Posts Using JSON API

I found this this url got me the results I needed – http://scd.blaze.wpengine.com/wp-json/posts?type=listings&filter[listing_area]=channel my post type being listings and the slug of my term channel