hi, I am aware there are far easier and simpler ways to solve this problem, but due to certain circumstances, I am unable for instance to change filetypes etc..
so, here we go:
using wordpress with the thesis theme, I need to append an html file(shop.html) onto a page(gardens).
my original solution was to use a DOM parser to get the html into a php file(test.php), which I then include()d onto the page, replacing the page content with my own code:
<?php include( TEMPLATEPATH.'test.php');
now however, I need to add the html file at the end of a page with other text on it. I thought that a shortcode solution would do the trick. what I did was:
function ce_snowdrop_shop(){
return include( TEMPLATEPATH . 'test.php' );
}
add_shortcode('snowdrop-shop', 'snowdrop_shop');
in the post I added [snowdrop-shop] at the end, and it worked - the code all showed up, but in the wrong place.
the shop.html code appeared ahead of the post and where the shortcode was, '1' appeared.
I then tried:
function ce_snowdrop_shop(){
$shop = file_get_contents( TEMPLATEPATH . 'test.php' );
return $shop;
}
that sorted out the layout, but instead of shop.html code, it just returned the dom parser code from test.php
so my question is:
if shop.html has to stay an html file, how can I append it to the end of a wordpress page?
also, is there a way of executing test.php before saving it into a string so that it will give the code from shop.html?
i realise this may seem rather complicated, and could be solved easily if shop.html was changed into shop.php.. but unfortunately, I can't do that. so please help me out. Thanks!