<![CDATA[ Running Wordpress functions in MODx - My Forums]]> https://forums.modx.com/thread/?thread=48979 <![CDATA[Re: Running Wordpress functions in MODx]]> https://forums.modx.com/thread/48979/running-wordpress-functions-in-modx?page=2#dis-post-286176 require(’blog/wp-blog-header.php’); interferes with header information for other services:

For example:


  • RSS feed validation for MODx, causing Feedburner to substitute the WP blog feed for MODx-based RSS feeds. Feed validation services also produce an error.
  • PayPal IPN validation errors.
  • Google Adwords: "Reason for disapproval: Invalid HTTP Response Code"


Would be more ideal to include wp-blog-header.php in the template itself rather than hardcoded in MODx’s index.php file, which would also avoid overwriting the include when updating MODx.]]>
hotdiggity May 24, 2010, 06:15 PM https://forums.modx.com/thread/48979/running-wordpress-functions-in-modx?page=2#dis-post-286176
<![CDATA[Re: Running Wordpress functions in MODx]]> https://forums.modx.com/thread/48979/running-wordpress-functions-in-modx?page=2#dis-post-286175 Here’s a code suggestion for wp_function, duplicating the WP index code as a snippet. While the WP functions are returning the correct data, the html tags (outside the WP functions) aren’t displaying, so <div>s, <h3>, and <a> tags aren’t appearing in the output leaving a horrible formatted mess of data! Any ideas please? Have tried "echo" without much difference.don’t know if it helps, but there’s also this:
http://www.allebrum.com/current_projects/allebrum-wordpress-tools-for-modx
http://modxcms.com/forums/index.php?topic=46030.0
]]>
anonymized-26931 May 23, 2010, 11:28 PM https://forums.modx.com/thread/48979/running-wordpress-functions-in-modx?page=2#dis-post-286175
<![CDATA[Re: Running Wordpress functions in MODx]]> https://forums.modx.com/thread/48979/running-wordpress-functions-in-modx?page=2#dis-post-286174

<?php
$output = '';
if (have_posts()) : while (have_posts()) : the_post(); 
$output .= the_date('','<h2>','</h2>');
$output .= '<div ' . post_class() . 'id="post-' . the_ID() . '" >';
$output .= '<h3 class="storytitle"><a href="' . the_permalink() . '" rel="bookmark">' . the_title() . '</a></h3>';
$output .= '<div class="meta">' . _e("Filed under:") . the_category(',') . '—' . the_tags(__('Tags: '), ', ', ' — ') . the_author() . '@' . the_time() . edit_post_link(__('Edit This')) . '</div>';
$output .= '<div class="storycontent">' . the_content(__('(more...)')) . '</div>';
$output .=  '<div class="feedback">' . wp_link_pages() . comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')) . '</div>';
$output .= '</div>';
$output .= comments_template();
    
endwhile; else:
$output .= _e('Sorry, no posts matched your criteria.') . '</p>';

endif;
$output .= posts_nav_link(' — ', __('« Newer Posts'), __('Older Posts »'));

return $output;
?>
]]>
hotdiggity May 23, 2010, 08:15 PM https://forums.modx.com/thread/48979/running-wordpress-functions-in-modx?page=2#dis-post-286174
<![CDATA[Re: Running Wordpress functions in MODx]]> https://forums.modx.com/thread/48979/running-wordpress-functions-in-modx?page=2#dis-post-286173 hotdiggity May 23, 2010, 07:14 PM https://forums.modx.com/thread/48979/running-wordpress-functions-in-modx?page=2#dis-post-286173 <![CDATA[Re: Running Wordpress functions in MODx]]> https://forums.modx.com/thread/48979/running-wordpress-functions-in-modx?page=2#dis-post-286172 Just testing something out and it appears that the "wp_bridge" snippet doesn’t need to be called at the start of a template, if there is the include statement (noted above) in the "index.php" file.
On MODx side I get the error:

"MODx is not currently installed or the configuration file cannot be found. Do you want to install now?"

And on the WP side, it looks like the "modx_bridge" code can be included in the functions.php file. This then means that the "require_once" statement doesn’t need to be included in the various templates.

Works fine on WP side, but again creates the above error on MODx pages...]]>
hotdiggity May 21, 2010, 06:25 PM https://forums.modx.com/thread/48979/running-wordpress-functions-in-modx?page=2#dis-post-286172
<![CDATA[Re: Running Wordpress functions in MODx]]> https://forums.modx.com/thread/48979/running-wordpress-functions-in-modx?page=2#dis-post-286171
	define('MODX_SITE_BASE_URL', '/');

]]>
hotdiggity May 21, 2010, 05:23 AM https://forums.modx.com/thread/48979/running-wordpress-functions-in-modx?page=2#dis-post-286171
<![CDATA[Re: Running Wordpress functions in MODx]]> https://forums.modx.com/thread/48979/running-wordpress-functions-in-modx?page=2#dis-post-286170 require(’/blog/wp-blog-header.php’);

should be just
require('blog/wp-blog-header.php');


(on Linux, at least)]]>
hotdiggity Mar 04, 2010, 10:55 PM https://forums.modx.com/thread/48979/running-wordpress-functions-in-modx?page=2#dis-post-286170
<![CDATA[Re: Running Wordpress functions in MODx]]> https://forums.modx.com/thread/48979/running-wordpress-functions-in-modx?page=2#dis-post-286169
And on the WP side, it looks like the "modx_bridge" code can be included in the functions.php file. This then means that the "require_once" statement doesn’t need to be included in the various templates.

...which simplifies things a bit. I might find out that I’ve overlooked something, but if anyone is trying this out, it might be worth just testing those two changes first.

MattC]]>
mconsidine Jan 25, 2010, 01:20 PM https://forums.modx.com/thread/48979/running-wordpress-functions-in-modx?page=2#dis-post-286169
<![CDATA[Re: Running Wordpress functions in MODx]]> https://forums.modx.com/thread/48979/running-wordpress-functions-in-modx#dis-post-286168
I’m not sure the databases was all that happy with this work. Maybe my host was having a glitch, but at one point I got a database error and needed to revisit the site. Didn’t need to reload anything - it was more of a hiccup than a problem. But one thing that had been working - using a snippet to return the title of a document in the "Title" field of the document settings - no longer works. Dunno why.

In any event, here’s the site
http://www.considine.net/testinstall
You’ll see the snowflakes, cartoon-of-the-day and quotes widgets that are installed in Wordpress as soon as you load the MODx page. If you hit the blog, you’ll see how the style is carried over. Not completely gracefully, but I’m shooting for proof of concept.

Also, I’ve set up a demo user : username = demo pwd = modxwp. If you log in you should be able to explore the template, chunks and snippets and see what I’ve been trying to do.

Finally, the Wordpress theme files that I editted are zipped up and available here
http://www.considine.net/testinstall/wpmodx.zip

I can’t reiterate enough that this is an experiment-in-progress and messing with this stuff might well screw something up. So - caveat emptor! But I hope it helps someone better than me come up with some clever routines.

MattC]]>
mconsidine Jan 23, 2010, 05:25 PM https://forums.modx.com/thread/48979/running-wordpress-functions-in-modx#dis-post-286168
<![CDATA[Re: Running Wordpress functions in MODx]]> https://forums.modx.com/thread/48979/running-wordpress-functions-in-modx#dis-post-286167
thanks for sharing. Do you think you could work this out, with a doc so even I could understand it.
I have been trying to do the same, but I lack PHP skills, so keep up the good work,

frank]]>
franklos Jan 23, 2010, 03:44 PM https://forums.modx.com/thread/48979/running-wordpress-functions-in-modx#dis-post-286167