I have done searches of both Google and the archives here and don’t really have an answer to this. So ...
I would like to be able to show Wordpress results on a page within a MODx site. I understand that I need to include wp-blog-headers.php and I did that by putting that on the second line of the site’s index.php.
My first question is whether or not there’s a better place to do that? I tried adding it in a header chunk, but that didn’t seem to work.
Next, I created a document that had the template I wanted to use for styling and added The Loop code from the "classic theme" index.php found on the Wordpress install (as outlined here
http://moshublog.com/2005/07/05/integrate/2/)
Initially, I thought I could put all the output into a variable and return that at the end of the snippet. But that didn’t generate the expected results, as it seems some of the WP functions do not really return a string.
What ended up basically working was this :
<?php
if (have_posts()) : while (have_posts()) : the_post();
the_date('','<h2>','</h2>');
echo '<div ';
post_class();
echo ' id="post-' . the_ID() . '"><h3 class="storytitle"><a href="';
the_permalink();
echo '" rel="bookmark">';
the_title();
echo '</a></h3>';
echo ' <div class="meta">' . _e("Filed under:") . the_category(',') . ' —' . the_tags(__('Tags: '), ', ', ' — ') . the_author() . '@' . the_time() . edit_post_link(__('Edit This')) . '</div>';
echo ' <div class="storycontent">';
the_content(__('(more...)'));
echo ' </div>';
echo ' <div class="feedback">';
wp_link_pages();
comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)'));
echo ' </div>';
echo '</div>';
comments_template(); // Get wp-comments.php template
endwhile; else:
echo '<p>' . _e('Sorry, no posts matched your criteria.') . '</p>';
endif;
?>
So my second question is : "Is there a better way to implement this code?"
The third question is pretty much trivia at this point, namely, does anyone know what has happened to the (Japanese?) "Wordpress-Integrator" snippet that one finds referenced in the archives?
Thanks in advance for sharing any experiences, tips, resources along these lines!
Matt