Luxurious Scents Posted October 1, 2018 Share Posted October 1, 2018 Hello everyone, I'm currently working on my ecommerce site with prestashop 1.7.4 with a custom theme and I was wondering if it was possible for me to incorporate/integrate a specific Wordpress Widget (on my WP Blog) with Prestashop. Does anyone have any experience with this? If so, do you mind explaining to me how it would work? P.s: I'm not a presta/wordpress master, so please bare with me! Thanks heaps! Samia Link to comment Share on other sites More sharing options...
Nishith Nesdiya Posted October 1, 2018 Share Posted October 1, 2018 Hi.. Here is WordPress API document if you call the within your prestashop then need to call this api with your prestashop codehttps://developer.wordpress.org/rest-api/ Thanks Link to comment Share on other sites More sharing options...
Luxurious Scents Posted October 1, 2018 Author Share Posted October 1, 2018 Thanks for that Nishith, but looking at al the technical jargon.. I wouldn't even know where to begin man lol. Link to comment Share on other sites More sharing options...
Nishith Nesdiya Posted October 1, 2018 Share Posted October 1, 2018 Hi... here is example recent post api call in WordPress blog site to function getWorpressRecentPosts() { $wordpressrecentposts = array(); $url = "http://example.com/wp-json/wp/v2/posts"; $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_URL, $url); $result = curl_exec($ch); $getblogposts = json_decode($result, true); foreach ($getblogposts as $getblogpost) { $wordpressrecentposts[] = array( 'id' => $getblogpost['id'], 'title' => $getblogpost['title']['rendered'], 'excerpt' => $getblogpost['excerpt']['rendered'], 'date' => date('F j, Y', strtotime($getblogpost['date'])), ); } return $wordpressrecentposts; } if you need call other content in your wordpress site then read the WordPress api Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now