0

我目前将Xsilva Lightspeed其用作我网站的电子商务部分,并将 Wordpress 用作我网站的 CMS 部分。我想把 Wordpress 放在我的电子商务网站中,这样客户就可以访问他们的帐户、购物车、总计等,同时仍然使用 Wordpress 从任何地方更新任何其他内容,例如我的博客。我不能用 Lightspeed 做到这一点。

我的问题是两个程序可以一起使用,我可以Wordpress Codex在 Lightspeed 页面中使用,还是 php 语言相互竞争?我将所有的 Wordpress 文件放在我的电子商务文件夹中。

我尝试使用 Wordpress codex 在 Lightspeed 上发布我的 Wordpress 中的内容,即:

<?php
    $my_id = 17;
    $post_id_17 = get_post($my_id, ARRAY_A);
    $title = $post_id_17['post_content'];
?>

我没有收到错误,但没有出现任何内容。难道我做错了什么?

4

1 回答 1

1

I dunno lightspeed, but I have integrated WP with other sites (magento, specifically)... fort instance, I need to use WP to manage a bunch of news posts, but the content needs to appear through out a magento store.

Usually what I do is to use the WP-JSON-API plugin to serve the content as a custom JSON call:

http://wordpress.org/extend/plugins/json-api/

And then I write whatever is necessary to call the info from the external WP install and pop it in the page. This makes it pretty easy to just CURL to get the JSON, and then you decode that to an array to populate whatever content you need.

The other way, that would be in line with what you've tired, would be to include files from WP inside the lightspeed install... there very well may be some plugin somewhere that does this, but IMO, that is a more complicated route to take as you have to juggle two programs in the same space.

于 2013-03-24T04:51:30.830 回答