require(’/blog/wp-blog-header.php’);
require('blog/wp-blog-header.php');
define('MODX_SITE_BASE_URL', '/');
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.
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.
<?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; ?>
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: