thanks to help provided by this forum, I have managed to develop a plugin that uses a database of UK towns & postcodes - using the URL parameters to build up a query & display the results. I'm at the stage now where I need to format the page - and this is where things aren't working as expected.
Lets say I click on a link for "england" - this queries the DB for all the counties / states in the UK. Extract from the Filter / plugin looks like the following:
$content = get_the_content();
$test = fs_query(get_query_var('delivery_country'));
//$content = 'Delivery location is ' . get_query_var('delivery_country');
//$content = str_replace( 'XXXXXXXXXX', fs_query(get_query_var( 'delivery_country')), $content );
//$content = str_replace( 'YYYYYYYYYY', get_query_var( 'delivery_country' ), $content );
$content .= $test;
return $content;
The function and the query work - lets say url was xyz\delivery\england then the plugin queries the DB for all counties in england. The results from the query are stored in the variable $test. What I am trying to do - as you can see from the various statements is modify the content of the page with the values in "$test".
No matter what I do, the values in $test appear first. Ideally, I want the contents of $test to appear in the middle of the page (where XXXXXXXXXX is located)?
Is there something I need to do that I am missing
Many thanks in advance....