Forums Forums Search & Filter Pro Setting a filter value on shortcode

Viewing 7 posts - 1 through 7 (of 7 total)
  • Anonymous
    #100103

    Hi

    I am running a custom theme, and have several custom post types that can be tagged with a custom taxonomy called destination.

    On the single template, below the post content, I want to show all other posts tagged with that same destination.

    On the template, I have both filter and results shortcodes, and both are working as expected.
    The results are showing, but as no filter is set on page load, it show all the posts.

    What I would like to know is if its possible to pre-set a filter on the shortcode to reflect the taxonomy that the post is tagged with, so that on page load the correct destination posts ar filtered

    eg:

    On a post tagged with ‘africa’, can I do something like:
    <?php
    $destination = ‘africa’; // get_term
    echo do_shortcode(“[searchandfilter slug=’cards-filter’ _sft_destination=$destination]”);
    ?>

    Any help with this would be greatly appreciated.
    Thanks

    Trevor
    #100131

    That shortcode is from the free version I think?

    Anonymous
    #100342

    Oh, I have the licensed plugin installed and that’s the shortcode I’ve been using.
    Regardless, is what i am asking possible and if so how do I do it?

    Thanks

    Trevor
    #100391
    This reply has been marked as private.
    Anonymous
    #100400
    This reply has been marked as private.
    Trevor
    #100458

    I replied on Skype, but I guess you are away right now. Tomorrow maybe?

    Trevor
    #100608

    Ok. Great to talk with you Dominic. The only way you can do what you want, I think, is to use PHP to detect the destination category term, and then feed that into the S&F query using our Edit Query Arguments filter.

    Let me know if you need any other help, or whether I can close the thread?

Viewing 7 posts - 1 through 7 (of 7 total)