You are here:  » Post and filter


Post and filter

Submitted by henk on Mon, 2012-10-22 18:39 in

Hi David,

One little problem, when i make a post in wordpress with a shortcode and go to the homepage the filter is grabbing [pto search="Keywords"] the keyword:

Thx
Henk

Submitted by support on Tue, 2012-10-23 09:37

Hi Henk,

I didn't see a code section in your post i'm afraid - could you post the actual shortcode you are using and if possible a link to the page on your site (I'll remove before publishing your reply) that demonstrates the problem and I'll check it out...!

Cheers,
David.
--
PriceTapestry.com

Submitted by henk on Tue, 2012-10-23 10:28

Hi david,

When you go to the homepage you see the filter already filtering it's calling [pto search="Supertrash"]

Thx
Henk

Submitted by support on Tue, 2012-10-23 10:53

Hello Henk,

Ah I see - the sidebar filters need to be conditional to only apply to a normal query page - at the moment it looks at the pto_q variable which ends up being set if you have called a search shortcode on the page.

I have flagged this to resolve in the next verison; in the mean time; to fix this first look for the following code at line 608 in pto.php:

    $html .= pto_search();

...and REPLACE with:

    $html .= pto_search();
    global $pto_q2;
    $pto_q2 = $pto_q;

Then in pto_search.php, look for this code within the sidebar filter widget at line 814:

    global $pto_q;

...and REPALCE with:

    global $pto_q2;
    if (!isset($pto_q2) || (!$pto_q2)) return;
    $pto_q = $pto_q2;

Cheers,
David.
--
PriceTapestry.com

Submitted by henk on Tue, 2012-10-23 11:45

Thx

Worked..