Integrate a wordpress plugin into a non-wordpress page

Hi - I don’t know whether this belongs in wordpress or php forums? I started a thread here:

and here:
https://wordpress.org/support/topic/integrating-ajax-into-non-wordpress-page?replies=1#post-7540793

I’m trying to use the plugin Ajax Testimonials in a non-wordpress page “1mst.php” one folder down from root (“greensmoothie.com/1cde/1mstphp”). See https://wordpress.org/plugins/ivycat-ajax-testimonials/

In 1mst.php it accepts this inside the <head> tag:

<?php require('../wp-blog-header.php');?>

but not this:

<?php require('http://greensmoothie.com/wp-blog-header.php');?>

even though wp-blog-header IS in that root folder on the server. When I give that absolute address, it throws up this error msg:

Warning: require(): http:// wrapper is disabled in the server configuration by allow_url_include=0 in C:\wamp\www\1gn\1cde\1mst.php on line 16

Warning: require(http://greensmoothie.com/wp-blog-header.php): failed to open stream: no suitable wrapper could be found in C:\wamp\www\1gn\1cde\1mst.php on line 16

So long as I have this inside <head>

<?php require('../wp-blog-header.php');?>

then this code from Ajax inside <body>:

<?php echo do_shortcode("[ic_do_testimonials quantity='3' speed='6000' fade_in='600' fade_out='700' group='writing']"); ?>

will display just the first testimonial, when it’s supposed to rotate through all 3.

I’ve tried this:

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    [ic_do_testimonials quantity='30' speed='6000' fade_in='600' fade_out='700' group='writing']
<?php endwhile; endif; ?>

but that fails to display anything. So I tried this:

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <?php echo do_shortcode("[ic_do_testimonials quantity='3' speed='6000' fade_in='600' fade_out='700' group='writing']"); ?>
<?php endwhile; endif; ?>

and it also displays a blank.

Do you perhaps have any idea how I can use a wordpress plugin on a non-wordpress page? This page makes it sound so simple:
http://codex.wordpress.org/Integrating_WordPress_with_Your_Website

thank you! - Val

Have you thought about generating an XML file with the data in it then using an RSS feed parser on the remote site to output the content?

Hi - gosh that’s too complicated for me. I just need to find out how wordpress features are integrated into a non-wordpress page the way the codex describes it can be done. This page also makes it sound easy:

Tracy at http://www.worldoweb.co.uk/ gave me the solution. So I have Ajax testimonials working now perfectly on my non-wordpress pages.

In your non-wordpress page’s html, this must be before doctype:

<?php require '../wp-blog-header.php';?>

This must be last before </head>:

<?php wp_head(); ?><!--enables js+css to load for wp plugins-->

And this must be last before </body>

<?php wp_footer(); ?><!--enables js+css to load for wp plugins-->

The loop isn’t required.

Val

OR just Include the wp-config.php file to connect to your database (if required). If you don’t want to have your non wordpress page(s) to use the WordPress css/js don’t include the wp-blog-header.php tag.

If you upload a directory to your web server with your code in, WordPress wont override it. It will run. So you can do whatever you want basically.

(If you want to integrate WP and your plugin follow the other member steps)

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.