Rectangle 27 0

php Wordpress: Passing post content into div using AJAX?


$.get('http://demo.wp-api.org/wp-json/wp/v2/posts/470',function(data){
    data = JSON.parse( data );
    $('div.selector').html( data.content );
})

You can use the REST API for worpdress (at http://v2.wp-api.org/ ) this way you can load the post content with ajax and append it to your div as you see fit

Note