# Connect wordpress with cakephp 4.2

**URL:** <https://discourse.cakephp.org/t/connect-wordpress-with-cakephp-4-2/10215>\
**Category:** Need Help\
**Created:** [March 8, 2022, 9:00pm UTC](https://discourse.cakephp.org/t/connect-wordpress-with-cakephp-4-2/10215 "2022-03-08T21:00:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdeanquin](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/mdeanquin/32/1802_2.png) [@mdeanquin](https://discourse.cakephp.org/u/mdeanquin)\
**Post date:** [March 8, 2022, 9:00pm UTC](https://discourse.cakephp.org/t/connect-wordpress-with-cakephp-4-2/10215/1 "2022-03-08T21:00:43Z")

</div>

Is there a way to create a template in wordpress that contains a view of cakephp? I need to create pages in wordpress that execute the different actions in the controllers of cakephp.  
In the root directory I have the directories of cakephp and another one that contains the installation of wordpress.

---

<div class="post-metadata">

**Author:** ![Zuluru](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/zuluru/32/1230_2.png) [@Zuluru](https://discourse.cakephp.org/u/Zuluru)\
**Post date:** [March 8, 2022, 9:30pm UTC](https://discourse.cakephp.org/t/connect-wordpress-with-cakephp-4-2/10215/2 "2022-03-08T21:30:45Z")

</div>

Last time I tried this, it failed because there were a number of functions that both systems try to define, which kills PHP. But that was Cake 1.3. I think that with Cake being namespaced, the list might now be reduced to just part of the `__` family, and if you don’t actually use those then it _might_ be okay.

What I’ve done instead is to create a page in WordPress, not liked from any menu, called something like “cake\_template”, which has a title of “[TITLE]” and “[BODY]” for the content. My Cake layout then pulls that page via cURL (cached, so you don’t do this on every page load), and does some search and replace with the actual title and content of the page being rendered. It’s not a super clean solution, as there are generally also headers that need mangling, but it’s generally pretty functional.

---

<div class="post-metadata">

**Author:** ![deepvyas](https://avatars.discourse-cdn.com/v4/letter/d/e0b2c6/32.png) [@deepvyas](https://discourse.cakephp.org/u/deepvyas)\
**Post date:** [April 1, 2022, 10:39am UTC](https://discourse.cakephp.org/t/connect-wordpress-with-cakephp-4-2/10215/3 "2022-04-01T10:39:51Z")

</div>

> [@mdeanquin](#):
>
> I need to create pages in wordpress that execute the different actions in the controllers of cakephp.

Think that’s possible did similar for CodeIgniter and WordPress.
