You are here:  » More control in wordpress posts

Support Forum



More control in wordpress posts

Submitted by Paul1107 on Tue, 2009-09-15 19:07 in

Hi David,

I use the following calling code to get products to show in my posts, overall the result are broadly what I require, however, just wanted a little more control over output.

<?php
 $external_baseHREF = "http://www.s229581664.websitehome.co.uk/mystore/";
 $external_path = "/kunden/homepages/45/d229581650/htdocs/mystore/";
 if (!$_GET["q"] && !$_GET["r"] && !$_GET["merchant"])
 {
   $_GET["q"] = "%sequin%" ;
   $_GET["sort"] = "priceDesc";
   $_GET["maxPrice"] = "1000";
  $_GET["minPrice"] = "20";
 }
 require($external_path."external.php");
?>

So for example, with the above code I really would like to get all sequin dresses from the db, but by entering "%sequin dress%" I get all dresses, but with "%sequin%" I get anything that has sequin in the title. is there a parameter I could use which will only show "sequin dresses"?

Secondly, sometimes the number of products goes into more than one page as is the case with the above example, upon following the pagination and clicking on other pages (Page 2,3,4...etc) you arrive back the home page rather than another product page. Therefore I would like to explore whether there is a way to either click through to subsequent product pages, or/and limit the number of products I can show in a post, which can override the parameter set in config.php.

I hope you can understand my question?

Regards

Paul

Submitted by support on Wed, 2009-09-16 06:52

Hi Paul,

I think the regular search (which defaults to AND) would be better in this instance - for a niche site anwyay. The easiest way to do this is to look for the following code on line 345 of external.php:

    if ($useFullText)

...and REPLACE that with:

    if (FALSE)

The subsequent page problem sounds like a URL issue; and should be easily sorted with a small modification to html/navigation.php. If you could email me that file, together with your external.php and a link to the page showing the external results where the next / previous navigation is not working i'll check it out...

Cheers,
David.

Submitted by Paul1107 on Wed, 2009-09-16 12:40

Hi David

am sending you all the file you require by email, INCLUDING the external.php which I have altered, but with text on line 404 can you check I've amended the correct instance?(as per your first amendment above) as the file has been extensive updated.

Submitted by support on Wed, 2009-09-16 12:53

Thanks, Paul - I'll follow up by email.

Cheers,
David.