Shortcode or PHP for page template

Forums › Forums › Search & Filter Pro › Shortcode or PHP for page template

Viewing 5 posts – 1 through 5 (of 5 total)
  • Anonymous
    #26021

    Hi there,

    We’re looking for a way to add a shortcode (or php code into a page template) so that particular products in our store appear within a page, without using the search. So, the URL for our search is:
    http://www.site.com/?sfid=139925&_sft_product_cat=tool-boxes-tool-storage&_sft_product_brand=Faithfull

    How can we get that search result in a page using a shortcode or php within a page template?

    Thanks! 🙂 Loving the plugin so far. Keep up the good work.

    Ross Moderator
    #26081

    Hey there, thanks for the kind words.

    I think what you are looking for is to display your results using a shortcode – which you can then embed in a page – check the docs here:

    http://www.designsandcode.com/documentation/search-filter-pro/search-results/using-a-shortcode/

    Thanks

    Anonymous
    #26087

    thanks for the reply. No, that isn’t what I am after.

    I am essentially looking to show particular products/results based on a KNOWN filter (as per my example). I do not want users to need to perform a search. They just visit Page X and it will list the products/results. Similar to using a woocommerce shortcode to display a particular product ID or category. I want the bring in particular products/results, as per my example URL above (but without performing the search). Does that make sense?

    Anonymous
    #26165

    Hey, any thoughts on this guys?

    Ross Moderator
    #26205

    Hey there

    I’m afraid this is not an option really.

    The closest thing that exists in S&F is to:

    1) Create a search form,
    2) configure defaults, and include/exclude options
    3) set display mode to “shortcode”
    4) use the results shortcode to display the posts

    I think what you are looking for is something more dynamic.

    There is 1 way to achieve something similar using code. There is a fairly undocumented filter which means you can change the filter that gets applied to hte results.

    Please see here:

    http://www.designsandcode.com/documentation/search-filter-pro/2-0-upgrade-notes/#No_more_pre_get_posts

    This filter allows you to change most of the regular parameters that are passed to to WP_Query – which may do what you want (you would need to combine it with the results shortcode method described above).

    Hope that helps?

    Thanks

Viewing 5 posts – 1 through 5 (of 5 total)

Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.