Nice work! Thanks for the contribution.
I think these will give you the access you want to the $modx object for snippets in WP:
In MODx Revolution:
include 'path_to_modx_core/model/modx/modx.class.php';
$modx = new modx();
$modx->initialize('web');
You might want to use a context other then the default ’web’.
In earlier versions:
include_once(MODX_MANAGER_PATH.'/includes/document.parser.class.inc.php');
$modx = new DocumentParser;
Look just below that code in index.php for some options you might want to set.
Thanks for the suggestion -
I thought something like that might work. However, I wasn’t sure if you would need to include the config file as well.
I don’t think you need it in Revolution. You might in 0.9.6. There’s no harm in including it (manager/includes/config.inc.php).
What if my purpose is to integrate WP Posts & Comments in a ModX page? All my users are still fixed on wordpress for blog content, I can’t argue against them. I would still like the blog to be integrated inside my ModX site, especially for the blog to follow the site design. How can I use php to do that?
Right now, I have a the blog RSS feed parsed through PieX, but this is text only... links, images, embedding do not follow.
thx
Quote from: matjolic at Mar 03, 2009, 11:47 AM
What if my purpose is to integrate WP Posts & Comments in a ModX page? All my users are still fixed on wordpress for blog content, I can’t argue against them. I would still like the blog to be integrated inside my ModX site, especially for the blog to follow the site design. How can I use php to do that?
Right now, I have a the blog RSS feed parsed through PieX, but this is text only... links, images, embedding do not follow.
thx
If you search the forums, I think you’ll find some posts from people who have integrated WordPress with MODx in various ways. I’ve never done it.
Looks like 2 admins, not sure how it can be integrated into one. Wordpress admin is very complex.