We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4310
    • 2,310 Posts
    Here’s a ’lite’ mashup between an existing MODx site and a new Wordpress install ilre.com/blog
    The header, menu, footer and sidebar (from PROPERTIES BY DESTINATION and below) all come from MODx, the rest is Wordpress.
    The Wordpress theme was hacked about to include the MODx generated html content by a custom include function and uses a mix of MODx & Wordpress CSS.
    Most of the time was spent on understanding the way Wordpress worked, the MODx side of things was easy smiley
    The client is happy with the ’seemless’ integration, I am too, as I have another one to do which should now be fairly straightforward.
      • 26931
      • 2,314 Posts
      wow - looking good, great to see both systems get along nicely
        • 19374
        • 41 Posts
        You have done it really nice with Wordpress and MODx.


        I did it also on my site but I got some questions if it is possible to use the MODx AjaxSearch WITH Wordpress?
          • 4310
          • 2,310 Posts
          AjaxSearch 1.9.0 has a &whereSearch parameter, but it seems to be for tables within the MODx database only.
          Might be worth posting on the AjaxSearch forum.
            • 8345
            • 147 Posts
            Hey, nice job - I gave a try long ago to do same thing but didn’t work out. What did you write into Wordpress theme to include from MODx page? Or what did you hack in Worpress theme?
            Thanks, Kaspar.
              • 4310
              • 2,310 Posts
              To point you in the right direction:
              In my wordpress theme I added this to the functions.php file:
              function get_modx_content($url) {
              	$ch = curl_init();
              	curl_setopt ($ch, CURLOPT_URL, $url);
              	curl_setopt ($ch, CURLOPT_HEADER, 0);		
              	ob_start();
              	curl_exec ($ch);
              	curl_close ($ch);
              	$string = ob_get_contents();
              	ob_end_clean();  
              	echo $string;   
              }

              Then in the index.php file added the css & js files from MODx e.g.
               $base_url = 'http://www.modx-domain.com/';
              <link rel="stylesheet" type="text/css" href="<?php echo $base_url; ?>assets/templates/menu.css" />
              <script type="text/javascript" src="<?php echo $base_url; ?>assets/js/jquery.min.js"></script>
              

              In the index.php file where I needed the menu (a MODx page containing a Wayfinder call) or other content from MODx I added :
                <?php get_modx_content(''.$base_url.'wp_menu.html'); ?>

              This is the other MODx/Wordpress site I did, it only uses the MODx menu & footer.
                • 8345
                • 147 Posts
                Thanks a lot - I’ll give a try:)