开发者

Can I use external PHP scripts in wordpress?

I'm new in wordpress. I want to create a website to display my product stocks. An I want to use wordpress to maintain the content of the website.

I was wondering is there any way of using my own PHP scripts to access my 'product database' information within from WP and display them. Bascially, wordpress will use it's own database for text contents and my database to display product information.

Any help would be greatly appreciated.

Thanks,

Mab

p.s. I need two separate product databases because, I'll be using the product database to maintain the supply chain and clients will log in to the system (which will not use wordpress) to check prices, quantity and place orders (but no transaction). I just want to use wordpress to display company profile, w开发者_如何学Pythonhat it does and one page will let users to browse available product but no cart or transaction at this point.


You can add arbitrary PHP code in your templates. I'd recommend using a category or page specific template to include your product database as needed.


Here are some ways you can integrate with your product database:

1 - As mentioned above you can add arbitrary PHP code in your templates. This includes having a second DB connection to your product database.

2 - If WP is simply there for product display purposes, you can create table(s) in the same DB as WP and have a job to synch the new table(s) and the main products table(s). You can then use the $wpdb object to query the DB. You do not need to create a second DB connection. In fact, you might get away with not having to create tables at all. you can do periodic inserts/update in the tables WP uses for the media library.

I would love to hear what solution you end up using. I'm sure there will be others who can contribute to this thread.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜