Jump to content

Integrating Wordpress Widgets within Prestashop 1.7


Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...