Quantcast

ZF website, with /blog/ subfolder for Wordpress - how to integrate WP with my website

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

ZF website, with /blog/ subfolder for Wordpress - how to integrate WP with my website

Rishi Daryanani
Hi,

I've researched online (still researching) but would like to some help from the Zend Framework community please :)

We've built an e-commerce website with Zend Framework (with Postgresql), and the client has a separate /blog/ directory holding Wordpress (and a separate Mysql database). The client now wants us to load some of the WP feeds into the main website, for example the top 3 feeds under their "Latest news" page on the main ZF site.

1) This is quite easy with Wordpress, following the below article.
http://codex.wordpress.org/Integrating_Wordpress_with_Your_Website

However, researching online and trying it for myself, it seems like the best (or only) to include the core WP file (wp-blog-header.php) is by including it in bootstrap.php or index.php (i.e. before the ZF application runs).
e.g. http://www.squidgle.com/post/7

I'm just wondering, is this what everyone is doing? It seems unnecessary as I only need to include the wp-blog-header.php file on certain pages, so this could slow our site down unnecessarily when not needed.
I have a special Wordpress model mapper to fetch the data using WP functions, but I can't actually include the header file in the model because it is within a function (errors are thrown if I do this).

2) Even if the above is the only solution, has anyone done this for "Multisites" ? Our site has several languages and we need Wordpress to also be available in those languages, so the best solution seems like to use http://codex.wordpress.org/Create_A_Network - a Network of sites such as ourdomain.com/blog/ - for the UK version - and ourdomain.com/blog/de/ - for the German version, etc.


However, the above Wordpress link (http://codex.wordpress.org/Integrating_Wordpress_with_Your_Website) says "These directions will not work on a MultiSite Network.", but offers no solution to actually make it work. So it looks like I'm stuck. I've can see that people have been asking about this online but I'm just wondering if anyone here has done this, specifically to get the English Wordpress posts for the English main ZF site, and the German WP posts for the German ZF site, etc. Any help would be appreciated. I'll also try the WP forums but would love some feedback here..

Many thanks,
Rishi
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: ZF website, with /blog/ subfolder for Wordpress - how to integrate WP with my website

Bart McLeod
Hi Rishi,

I know a little about WordPress and a little about ZendFramework, but if I were you I would not mix their code, or at least I would not mix WP code into your ZF application code. I would just load a WordPress template inside your ZF template using curl for example. So you just create the templates you need on the WP side, just as you normally would for a WP site, but without the head and body of the html, just render an HTML snippet. Then in your ZF template you read that using file_get_contents or curl and echo it out. In your request to your WP blog, you can add all of the parameters needed to get the desired language out. Try to think of WP as an API that gives you certain HTML based on certain parameters. Don't mix the code.

Just my 2 cents.

-Bart

Op 10-06-12 14:44, Rishi Daryanani schreef:
Hi,

I've researched online (still researching) but would like to some help from the Zend Framework community please :)

We've built an e-commerce website with Zend Framework (with Postgresql), and the client has a separate /blog/ directory holding Wordpress (and a separate Mysql database). The client now wants us to load some of the WP feeds into the main website, for example the top 3 feeds under their "Latest news" page on the main ZF site.

1) This is quite easy with Wordpress, following the below article.
http://codex.wordpress.org/Integrating_Wordpress_with_Your_Website

However, researching online and trying it for myself, it seems like the best (or only) to include the core WP file (wp-blog-header.php) is by including it in bootstrap.php or index.php (i.e. before the ZF application runs).
e.g. http://www.squidgle.com/post/7

I'm just wondering, is this what everyone is doing? It seems unnecessary as I only need to include the wp-blog-header.php file on certain pages, so this could slow our site down unnecessarily when not needed.
I have a special Wordpress model mapper to fetch the data using WP functions, but I can't actually include the header file in the model because it is within a function (errors are thrown if I do this).

2) Even if the above is the only solution, has anyone done this for "Multisites" ? Our site has several languages and we need Wordpress to also be available in those languages, so the best solution seems like to use http://codex.wordpress.org/Create_A_Network - a Network of sites such as ourdomain.com/blog/ - for the UK version - and ourdomain.com/blog/de/ - for the German version, etc.


However, the above Wordpress link (http://codex.wordpress.org/Integrating_Wordpress_with_Your_Website) says "These directions will not work on a MultiSite Network.", but offers no solution to actually make it work. So it looks like I'm stuck. I've can see that people have been asking about this online but I'm just wondering if anyone here has done this, specifically to get the English Wordpress posts for the English main ZF site, and the German WP posts for the German ZF site, etc. Any help would be appreciated. I'll also try the WP forums but would love some feedback here..

Many thanks,
Rishi

--
Bart McLeod
Space Web
Middenlaan 47
6869 VN Heveadorp
The Netherlands
t +31(0)26 3392952
m 06 51 51 89 71
@ [hidden email]
www.spaceweb.nl
zce PHP 4 logo zce PHP 5 logo zce PHP 5.3 logo zce Zend Framework logo

Bart McLeod is a Zend Certified Engineer.

Click to verify!

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: ZF website, with /blog/ subfolder for Wordpress - how to integrate WP with my website

Ariz Jacinto
In reply to this post by Rishi Daryanani
Hi Rishi,

You might also want to try using the CMS Adapter class[1]. I created
it when I was integrating content hosted on WP and ZF application.

Ref:
[1] http://cmsadapter.acjacinto.com

--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]


Loading...